Commit 916c396c authored by Natanael Copa's avatar Natanael Copa

version: allow more digits come after letter

This is so we can handle arpwatch-2.1a15
This makes us not 100% compatible with Gentoo
parent 01a028cc
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment