autoupdater: consider end of string smaller than all characters except for '~'

This fixes ordering for the following patterns:

* 1.0 < 1.0a
* 1.0a < 1.0ab
* 1.0a < 1.0a1

Note that trailing zeros are still ignored (1.0 == 1., 1test0 == 1test),
which matches the behaviour of dpkg and opkg.
This commit is contained in:
Matthias Schiffer 2018-12-18 20:31:43 +01:00
parent 688051cb21
commit 30be52e03b
No known key found for this signature in database
GPG Key ID: 16EF3F64CB201D9C
1 changed files with 3 additions and 1 deletions

View File

@ -34,8 +34,10 @@ static int char_order(char c) {
return 0;
else if (isalpha(c))
return c;
else if (c == '~')
else if (c == '\0')
return -1;
else if (c == '~')
return -2;
else
return c + 256;
}