bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Human readable sort


From: Eric Blake
Subject: Re: Human readable sort
Date: Thu, 21 May 2009 14:24:07 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Pádraig Brady <P <at> draigBrady.com> writes:

> Looks like your copyright assignment papers went through.
> Attached is the latest patch rebased against master
> and with a couple of extra whitespace fixups.
> 

+static int
+find_unit_order (const char *number)
+{
+  static const char orders [UCHAR_LIM] = {
+    ['K']=1, ['M']=2, ['G']=3, ['T']=4, ['P']=5, ['E']=6, ['Z']=7, ['Y']=8,
+    ['k']=1,
+  }; 

This assumes more of C99 than we have previously required.  Are we sure that 
all compilers out there will support this syntax?

Also, your tests only cover 'sort -h'; what about covering 'sort -k1,1h'?

-- 
Eric Blake






reply via email to

[Prev in Thread] Current Thread [Next in Thread]