summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/sort.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/sort.c b/src/sort.c
index 4106973ac..6e1bd9e66 100644
--- a/src/sort.c
+++ b/src/sort.c
@@ -1324,10 +1324,17 @@ keycompare (const struct line *a, const struct line *b)
{
#ifdef ENABLE_NLS
if (need_locale)
- diff = memcoll (texta, lena, textb, lenb);
+ {
+ /* Ignore any length difference if the localized comparison
+ says the strings are equal. */
+ comparable_lengths = 0;
+ diff = memcoll (texta, lena, textb, lenb);
+ }
else
#endif
- diff = memcmp (texta, textb, min (lena, lenb));
+ {
+ diff = memcmp (texta, textb, min (lena, lenb));
+ }
}
if (diff)