Blame SOURCES/coreutils-8.22-sort-blanks.patch

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