basic/string-util: tweak strverscmp_improved() for some corner cases
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 24 May 2022 19:20:36 +0000 (21:20 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 25 May 2022 11:47:47 +0000 (13:47 +0200)
commit46083ab321826d920b32de85c7328a5f39b7fff4
treee8431aa93898c344c4bb36032f5bed6915b9df70
parent0f5a416c81917fb85ed6d8043041660c310cc8d9
basic/string-util: tweak strverscmp_improved() for some corner cases

So far we had the rule that '' == '', '0_' == '0', but '_' > ''. This means
that the general rule that strings are compared iteratively, and each
segment that compares equal can be dropped and the comparison resumes at
the following characters wasn't true in such cases. Similarly, '0~' < '0',
but after dropping the common segment, '~' > ''.

The special handling of empty strings is dropped, and '_' == '' and
'~' < ''.
src/fundamental/string-util-fundamental.c
src/test/test-string-util.c