From b5cf9e52ca437f8203bca59359383c9270821131 Mon Sep 17 00:00:00 2001 From: David Adam Date: Tue, 28 May 2019 22:04:31 +0800 Subject: [PATCH] wcsfilecmp: be clearer about sorting "-" after letters --- src/util.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/util.cpp b/src/util.cpp index 0b1080cbb..3503d7bab 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -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;