diff options
author | Sebastian Hahn <sebastian@torproject.org> | 2010-07-26 06:40:44 +0200 |
---|---|---|
committer | root <root@Rhun.(none)> | 2010-07-26 20:39:12 +0200 |
commit | 6cee3d466d0b5109c0dd47623003cd28680faa9e (patch) | |
tree | 59fa5641a349539c174f7e09675dc6e5d8c720ac | |
parent | 1d6656fcb34f4939f806ae4fbe10e7c5bcd75b25 (diff) | |
download | tor-6cee3d466d0b5109c0dd47623003cd28680faa9e.tar.gz tor-6cee3d466d0b5109c0dd47623003cd28680faa9e.zip |
Make sure we don't warn for libevent versions like 1.4.14b-stable
-rw-r--r-- | changes/bug1731 | 5 | ||||
-rw-r--r-- | src/common/compat_libevent.c | 10 |
2 files changed, 11 insertions, 4 deletions
diff --git a/changes/bug1731 b/changes/bug1731 new file mode 100644 index 0000000000..6d484e37e9 --- /dev/null +++ b/changes/bug1731 @@ -0,0 +1,5 @@ + o Minor bugfixes: + - Our libevent version parsing code couldn't handle versions like + 1.4.14b-stable and warned the user about using an old and broken + version of libevent. Treat 1.4.14b-stable like 1.4.14-stable when + parsing the version. Fixes bug 1731; bugfix on 0.2.2.1-alpha. diff --git a/src/common/compat_libevent.c b/src/common/compat_libevent.c index 5cdd687cf0..140b6552d1 100644 --- a/src/common/compat_libevent.c +++ b/src/common/compat_libevent.c @@ -229,13 +229,15 @@ static le_version_t tor_decode_libevent_version(const char *v) { unsigned major, minor, patchlevel; - char c, extra; + char c, e, extra; int fields; - /* Try the new preferred "1.4.11-stable" format. */ - fields = sscanf(v, "%u.%u.%u%c", &major, &minor, &patchlevel, &c); + /* Try the new preferred "1.4.11-stable" format. + * Also accept "1.4.14b-stable". */ + fields = sscanf(v, "%u.%u.%u%c%c", &major, &minor, &patchlevel, &c, &e); if (fields == 3 || - (fields == 4 && (c == '-' || c == '_'))) { + ((fields == 4 || fields == 5 ) && (c == '-' || c == '_')) || + (fields == 5 && TOR_ISALPHA(c) && (e == '-' || e == '_'))) { return V(major,minor,patchlevel); } |