Browse Source

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.
pull/209/head
Matthias Schiffer 3 years ago
parent
commit
30be52e03b
No known key found for this signature in database GPG Key ID: 16EF3F64CB201D9C
  1. 4
      admin/autoupdater/src/version.c

4
admin/autoupdater/src/version.c

@ -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;
}

Loading…
Cancel
Save