Make sure we don't warn for libevent versions like 1.4.14b-stable

This commit is contained in:
Sebastian Hahn
2010-07-26 06:40:44 +02:00
committed by root
parent 1d6656fcb3
commit 6cee3d466d
2 changed files with 11 additions and 4 deletions
+5
View File
@@ -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.
+6 -4
View File
@@ -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);
}