diff options
author | Pádraig Brady <P@draigBrady.com> | 2013-01-09 12:23:35 +0000 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2013-01-26 02:35:58 +0000 |
commit | 326e5855bc8dd3d0c5b2c0e461c65879d2b5694d (patch) | |
tree | 283b502b0acaa235fab9ac8cbaf7ba49b2f32ee4 /src | |
parent | d302aed182d625281fba87aca3cb513882aa967b (diff) | |
download | coreutils-326e5855bc8dd3d0c5b2c0e461c65879d2b5694d.tar.xz |
seq: fix misaligment with -w when no precision for start value
* src/seq.c (get_default_format): Also account for the case where '.'
is auto added to the start value, which is significant when the
number sequence narrows.
* tests/misc/seq.pl: Add two new tests for the failing cases.
* NEWS: Mention the fix.
Fixes http://bugs.gnu.org/13394
Diffstat (limited to 'src')
-rw-r--r-- | src/seq.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -336,6 +336,8 @@ get_default_format (operand first, operand step, operand last) last_width--; /* don't include space for '.' */ if (last.precision == 0 && prec) last_width++; /* include space for '.' */ + if (first.precision == 0 && prec) + first_width++; /* include space for '.' */ size_t width = MAX (first_width, last_width); if (width <= INT_MAX) { |