GNU bug report logs -
#16468
join
Previous Next
Reported by: barry kesner <modockesner <at> gmail.com>
Date: Thu, 16 Jan 2014 17:07:01 UTC
Severity: normal
Tags: notabug
Done: Assaf Gordon <assafgordon <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
Message #29 received at 16468 <at> debbugs.gnu.org (full text, mbox):
On 05/01/2014 11:26 PM, Bernhard Voelker wrote:
> On 05/01/2014 01:53 AM, Pádraig Brady wrote:
>> I added it in the attached.
>
> Thanks, great stuff.
>
>> diff --git a/NEWS b/NEWS
>> index 7855a48..904aace 100644
>> --- a/NEWS
>> +++ b/NEWS
>> @@ -66,6 +66,9 @@ GNU coreutils NEWS -*- outline -*-
>> causing name look-up errors. Also look-ups are first done outside the chroot,
>> in case the look-up within the chroot fails due to library conflicts etc.
>>
>> + numfmt supports zero padding of numbers using the standard --printf
>> + syntax of a leading zero, for example --format="%010f".
>> +
>
> s/--printf/printf/
done
>> diff --git a/src/numfmt.c b/src/numfmt.c
>> index 63411f3..c744875 100644
>> --- a/src/numfmt.c
>> +++ b/src/numfmt.c
> ...
>> @@ -992,6 +1023,9 @@ parse_format_string (char const *fmt)
>>
>> if (endptr != (fmt + i) && pad != 0)
>> {
>> + if (debug && padding_width && !(zero_padding && pad > 0))
>> + error (0, 0, _("--format padding overridding --padding"));
>> +
>
> In --debug mode, it seems odd that the format with the new
> zero-padding does not lead to a warning ...
>
> $ src/numfmt --debug --format="%09f" --padding=2 1234
> 000001234
In this case the number of leading zeros and --padding are separate.
Since they're zero padded you can freely move around the numbers in a field like:
numfmt --header --field=2 --format="%010f" --padding=-15 < /proc/interrupts
> while a format without does:
>
> $ src/numfmt --debug --format="%9f" --padding=2 1234
> src/numfmt: --format padding overridding --padding
> 1234
Here the --padding is overridden hence the warning.
thanks for the review!
I've now pushed it.
Pádraig.
This bug report was last modified 6 years and 224 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.