From 916c396c0243695850a8117a748d89fa95e9605a Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Mon, 13 Apr 2009 09:13:09 +0000 Subject: version: allow more digits come after letter This is so we can handle arpwatch-2.1a15 This makes us not 100% compatible with Gentoo --- src/version.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/version.c b/src/version.c index 1f8b610..3d972fe 100644 --- a/src/version.c +++ b/src/version.c @@ -36,6 +36,8 @@ static void next_token(int *type, apk_blob_t *blob) } else if ((*type == TOKEN_DIGIT || *type == TOKEN_DIGIT_OR_ZERO) && islower(blob->ptr[0])) { n = TOKEN_LETTER; + } else if (*type == TOKEN_LETTER && isdigit(blob->ptr[0])) { + n = TOKEN_DIGIT; } else if (*type == TOKEN_SUFFIX && isdigit(blob->ptr[0])) { n = TOKEN_SUFFIX_NO; } else { @@ -61,7 +63,8 @@ static void next_token(int *type, apk_blob_t *blob) if (n < *type) { if (! ((n == TOKEN_DIGIT_OR_ZERO && *type == TOKEN_DIGIT) || - (n == TOKEN_SUFFIX && *type == TOKEN_SUFFIX_NO))) + (n == TOKEN_SUFFIX && *type == TOKEN_SUFFIX_NO) || + (n == TOKEN_DIGIT && *type == TOKEN_LETTER))) n = TOKEN_INVALID; } *type = n; -- cgit v1.2.3-70-g09d2