summaryrefslogtreecommitdiff
path: root/src/sort.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1999-05-20 16:29:38 +0000
committerJim Meyering <jim@meyering.net>1999-05-20 16:29:38 +0000
commitd30365509df7ced5f8134e8d40cd9581090b776b (patch)
tree0a79f6893101d0799db6524ba12f15b164b33607 /src/sort.c
parent9a27ea2eb272cfcc1a5146dac64ba700155e9d3a (diff)
downloadcoreutils-d30365509df7ced5f8134e8d40cd9581090b776b.tar.xz
(keycompare): Ignore any length difference if the
localized comparison says the strings are equal.
Diffstat (limited to 'src/sort.c')
-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)