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