summaryrefslogtreecommitdiff
path: root/src/sort.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2010-07-26 12:12:25 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2010-07-26 12:12:50 -0700
commit802542ff92a571edcadd18555ff1abb161fac589 (patch)
tree31675ef73767d0e1c018f2f44d1d596ee142f860 /src/sort.c
parent074566823ec313ad350e658c6765349d2ceef881 (diff)
downloadcoreutils-802542ff92a571edcadd18555ff1abb161fac589.tar.xz
sort: don't assume ASCII when parsing K, M, G suffixes
* src/sort.c (find_unit_order): Don't assume ASCII.
Diffstat (limited to 'src/sort.c')
-rw-r--r--src/sort.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/sort.c b/src/sort.c
index 577521d68..1fd4ce7b7 100644
--- a/src/sort.c
+++ b/src/sort.c
@@ -1818,7 +1818,11 @@ find_unit_order (char const *number, struct keyfield *key, char const **endptr)
{
static char const orders[UCHAR_LIM] =
{
-#if SOME_DAY_WE_WILL_REQUIRE_C99
+#if ! ('K' == 75 && 'M' == 77 && 'G' == 71 && 'T' == 84 && 'P' == 80 \
+ && 'E' == 69 && 'Z' == 90 && 'Y' == 89 && 'k' == 107)
+ /* This initializer syntax works on all C99 hosts. For now, use
+ it only on non-ASCII hosts, to ease the pain of porting to
+ pre-C99 ASCII hosts. */
['K']=1, ['M']=2, ['G']=3, ['T']=4, ['P']=5, ['E']=6, ['Z']=7, ['Y']=8,
['k']=1,
#else