[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#24015: [PATCH] sort: make -h work with -k and blank used as thousand
From: |
Pádraig Brady |
Subject: |
bug#24015: [PATCH] sort: make -h work with -k and blank used as thousands separator |
Date: |
Sun, 17 Jul 2016 21:05:13 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
> On 17/07/16 17:02, Kamil Dudka wrote:
>> diff --git a/src/sort.c b/src/sort.c
>> index f717604..a2cadda 100644
>> --- a/src/sort.c
>> +++ b/src/sort.c
>> @@ -1904,12 +1904,16 @@ find_unit_order (char const *number)
>> to be lacking in units.
>> FIXME: add support for multibyte thousands_sep and decimal_point. */
>>
>> - do
>> + while (ISDIGIT (ch = *p++))
>> {
>> - while (ISDIGIT (ch = *p++))
>> - nonzero |= ch - '0';
>> + nonzero |= ch - '0';
>> +
>> + /* Allow to skip only one occurrence of thousands_sep to avoid finding
>> + the unit in the next column in case thousands_sep matches as blank
>> + and is used as column delimiter. */
>> + if (*p == thousands_sep)
>> + ++p;
>> }
>> - while (ch == thousands_sep);
>
There is also similar logic in debug_key that would need the same adjustments.
cheers,
Pádraig.
- bug#24015: [PATCH] sort: make -h work with -k and blank used as thousands separator, Kamil Dudka, 2016/07/17
- bug#24015: [PATCH] sort: make -h work with -k and blank used as thousands separator, Pádraig Brady, 2016/07/17
- bug#24015: [PATCH] sort: make -h work with -k and blank used as thousands separator,
Pádraig Brady <=
- bug#24015: [PATCH v2 1/3] sort: deduplicate code for traversing numbers, Kamil Dudka, 2016/07/18
- bug#24015: [PATCH v2 3/3] sort: with -h, disallow thousands separator between number and unit, Kamil Dudka, 2016/07/18
- bug#24015: [PATCH v2 2/3] sort: make -h work with -k and blank used as thousands separator, Kamil Dudka, 2016/07/18
- bug#24015: [PATCH v2 1/3] sort: deduplicate code for traversing numbers, Pádraig Brady, 2016/07/18
- bug#24015: [PATCH v2 1/3] sort: deduplicate code for traversing numbers, Pádraig Brady, 2016/07/18
- bug#24015: [PATCH v2 1/3] sort: deduplicate code for traversing numbers, Kamil Dudka, 2016/07/19