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 /src/common/compat_libevent.c | |
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
Diffstat (limited to 'src/common/compat_libevent.c')
-rw-r--r-- | src/common/compat_libevent.c | 10 |
1 files changed, 6 insertions, 4 deletions
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); } |