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