openbabel/openbabel — pull request #100 by Synss (2014-11-04 10:27:08+00:00)
Title: Fix normal mode parsing in Gaussian format

This fixes a bug in the parsing of normal modes in the Gaussian format
where values in a single column would not be parsed at all. This could
make openbabel crash in some cases.

The normal modes in the gaussian format are presented in stacked groups
of five columns.

```
Atom AN X Y Z X Y Z X Y Z
1 6 -0.14 0.87 0.00 0.87 0.14 0.00 0.00 0.00 0.00
2 8 0.05 -0.33 0.00 -0.33 -0.05 0.00 0.00 0.00 0.71
3 8 0.05 -0.33 0.00 -0.33 -0.05 0.00 0.00 0.00 -0.71
```
The algorithm would parse the normal modes until `vs` contains less than
5 token. However, if the last set of normal modes is in a single column:
```
Atom AN X Y Z
1 6 0.00 0.00 0.88
2 8 0.00 0.00 -0.33
3 8 0.00 0.00 -0.33
```
The size of `vs` actually *is* 5, breaking the parsing loop early, and
eventually crashing openbabel.

Parsing normal modes until the columns are 'less than or equal to 5'
tokens fixes it.