Fix to allow 'compare_versions.m' handle version numbers ending with period

Muthiah Annamalai muthuspost at gmail.com
Mon Jan 26 12:42:25 CST 2009


Hello there,

I built Octave from sources (3.1.51+) and my gnuplot interface failed, 
for the following
reason: __gnuplot_version__() returns 4.2. in my computer, and 
compare_versions.m
script doesnt recognize version numbers ending with a "." as you can see 
from the
runs below.

__gnuplot_version__()
ans = 4.2.
octave:3> compare_versions( "4.2","4.0",">=")
ans = 1
octave:4> compare_versions( "4.2.","4.0",">=")
error: compare_versions: given version strings are not valid: 4.2. 4.0
error: called from:
error: /opt/share/octave/3.1.51+/m/miscellaneous/compare_versions.m at 
line 115, column 5
octave:4> compare_versions( "4.2.0","4.0",">=")
ans = 1
octave:5> compare_versions( "4.2","4.0",">=")
ans = 1
octave:6>


So my options were to either we can fix 
scripts/plot/__gnuplot_version__.m or compare_versions.m.
I think latter option is more general.

The changes pass the 30+ 2-new test cases in the same file.

The Changelog entry will be:

2009-01-26 Muthiah Annamalai <muthuspost at gmail.com>

* miscellaneous/compare_versions.m : Allow handling version numbers 
ending in a period.

The patch is attached to the email.

Thanks,
-Muthu



-------------- next part --------------
A non-text attachment was scrubbed...
Name: cmpv.diff
Type: text/x-patch
Size: 1188 bytes
Desc: not available
Url : https://www-old.cae.wisc.edu/pipermail/bug-octave/attachments/20090126/e83aca17/attachment.bin 


More information about the Bug-octave mailing list