summaryrefslogtreecommitdiffstats
path: root/src/version.c
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2009-04-13 09:13:09 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2009-04-13 09:13:09 +0000
commit916c396c0243695850a8117a748d89fa95e9605a (patch)
tree8ee27eecba20b0faaac267896d37f6787049feb5 /src/version.c
parent01a028cc2fa9fd52a9b17c24f9294ee980d6df85 (diff)
downloadapk-tools-916c396c0243695850a8117a748d89fa95e9605a.tar.bz2
apk-tools-916c396c0243695850a8117a748d89fa95e9605a.tar.xz
version: allow more digits come after letter
This is so we can handle arpwatch-2.1a15 This makes us not 100% compatible with Gentoo
Diffstat (limited to 'src/version.c')
-rw-r--r--src/version.c5
1 files changed, 4 insertions, 1 deletions
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;