From d30365509df7ced5f8134e8d40cd9581090b776b Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Thu, 20 May 1999 16:29:38 +0000 Subject: [PATCH] (keycompare): Ignore any length difference if the localized comparison says the strings are equal. --- src/sort.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/sort.c b/src/sort.c index 4106973acf..6e1bd9e66f 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) -- 2.47.3