Blame SOURCES/coreutils-i18n-sort-human.patch

e63663
From 3976ef5a20369d8b490907ab2cba2d617305a5e0 Mon Sep 17 00:00:00 2001
e63663
From: Kamil Dudka <kdudka@redhat.com>
e63663
Date: Mon, 30 May 2016 16:19:20 +0200
e63663
Subject: [PATCH] sort: do not use static array 'blanks' in human_numcompare()
e63663
e63663
... because the array is not initialized with MB locales.  Note this is
e63663
rather a conservative fix.  I plan to do more cleanup of the i18n patch
e63663
in Fedora to prevent mistakes like this in future updates of coreutils.
e63663
---
e63663
 src/sort.c | 8 +++-----
e63663
 1 file changed, 3 insertions(+), 5 deletions(-)
e63663
e63663
diff --git a/src/sort.c b/src/sort.c
e63663
index 9e07ad8..e47b039 100644
e63663
--- a/src/sort.c
e63663
+++ b/src/sort.c
e63663
@@ -2304,12 +2304,10 @@ find_unit_order (char const *number)
e63663
        <none/unknown> < K/k < M < G < T < P < E < Z < Y  */
e63663
 
e63663
 static int
e63663
-human_numcompare (char const *a, char const *b)
e63663
+human_numcompare (char *a, char *b)
e63663
 {
e63663
-  while (blanks[to_uchar (*a)])
e63663
-    a++;
e63663
-  while (blanks[to_uchar (*b)])
e63663
-    b++;
e63663
+  skipblanks(&a, a + strlen(a));
e63663
+  skipblanks(&b, b + strlen(b));
e63663
 
e63663
   int diff = find_unit_order (a) - find_unit_order (b);
e63663
   return (diff ? diff : strnumcmp (a, b, decimal_point, thousands_sep));
e63663
-- 
e63663
2.5.5
e63663