diff options
author | Theodore Ts'o <tytso@mit.edu> | 2005-01-06 23:52:45 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2005-01-06 23:52:45 -0500 |
commit | da83cb6e4833c7c19279d31c31c6c8b5851f17e2 (patch) | |
tree | bee730fa90321dfaf0227b98c624443f58e97a54 /lib/ext2fs | |
parent | c76564a8784c3c44a6a0516e0fc40f10ec6221ed (diff) | |
download | e2fsprogs-da83cb6e4833c7c19279d31c31c6c8b5851f17e2.tar.gz |
Update version to 1.36-rc1, and change parsing algorithm for version strings
so that it deals with -rc version numbers correctly.
Diffstat (limited to 'lib/ext2fs')
-rw-r--r-- | lib/ext2fs/ChangeLog | 6 | ||||
-rw-r--r-- | lib/ext2fs/version.c | 4 |
2 files changed, 9 insertions, 1 deletions
diff --git a/lib/ext2fs/ChangeLog b/lib/ext2fs/ChangeLog index 1eb5ed57..7b5e8029 100644 --- a/lib/ext2fs/ChangeLog +++ b/lib/ext2fs/ChangeLog @@ -1,3 +1,9 @@ +2005-01-06 Theodore Ts'o <tytso@mit.edu> + + * version.c (ext2fs_parse_version_string): Change parsing + algorithm so that version strings such as 1.36-rc1 returns + a non-surprising result (i.e., 136, and not 1361). + 2005-01-05 Theodore Ts'o <tytso@mit.edu> * block.c (block_iterate_ind, block_iterate_dind, diff --git a/lib/ext2fs/version.c b/lib/ext2fs/version.c index f8536fc7..f59ce879 100644 --- a/lib/ext2fs/version.c +++ b/lib/ext2fs/version.c @@ -30,8 +30,10 @@ int ext2fs_parse_version_string(const char *ver_string) int version = 0; for (cp = ver_string; *cp; cp++) { - if (!isdigit(*cp)) + if (*cp == '.') continue; + if (!isdigit(*cp)) + break; version = (version * 10) + (*cp - '0'); } return version; |