wcsfilecmp: be clearer about sorting "-" after letters

This commit is contained in:
David Adam 2019-05-28 22:04:31 +08:00
parent c848787107
commit b5cf9e52ca

View file

@ -62,8 +62,9 @@ int wcsfilecmp(const wchar_t *a, const wchar_t *b) {
wint_t al = towupper(*a);
wint_t bl = towupper(*b);
if (al == L'-') al += 48;
if (bl == L'-') bl += 48;
// Sort dashes after Z - see #5634
if (al == L'-') al = L'[';
if (bl == L'-') bl = L'[';
if (al < bl) {
retval = -1;