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.
(cherry picked from commit 30be52e03b
)
This commit is contained in:
parent
7348db07e2
commit
f49aef69e8
|
@ -34,8 +34,10 @@ static int char_order(char c) {
|
||||||
return 0;
|
return 0;
|
||||||
else if (isalpha(c))
|
else if (isalpha(c))
|
||||||
return c;
|
return c;
|
||||||
else if (c == '~')
|
else if (c == '\0')
|
||||||
return -1;
|
return -1;
|
||||||
|
else if (c == '~')
|
||||||
|
return -2;
|
||||||
else
|
else
|
||||||
return c + 256;
|
return c + 256;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue