diff options
author | Jim Meyering <jim@meyering.net> | 1999-05-20 16:29:38 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1999-05-20 16:29:38 +0000 |
commit | d30365509df7ced5f8134e8d40cd9581090b776b (patch) | |
tree | 0a79f6893101d0799db6524ba12f15b164b33607 /src | |
parent | 9a27ea2eb272cfcc1a5146dac64ba700155e9d3a (diff) | |
download | coreutils-d30365509df7ced5f8134e8d40cd9581090b776b.tar.xz |
(keycompare): Ignore any length difference if the
localized comparison says the strings are equal.
Diffstat (limited to 'src')
-rw-r--r-- | src/sort.c | 11 |
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) |