From: Jim Meyering Date: Thu, 20 May 1999 16:29:38 +0000 (+0000) Subject: (keycompare): Ignore any length difference if the X-Git-Tag: TEXTUTILS-1_22m~24 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d30365509df7ced5f8134e8d40cd9581090b776b;p=thirdparty%2Fcoreutils.git (keycompare): Ignore any length difference if the localized comparison says the strings are equal. --- 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)