diff options
author | Pádraig Brady <P@draigBrady.com> | 2009-02-14 17:20:37 +0000 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2009-02-14 23:47:14 +0000 |
commit | 5d0b158f4c7b7fa506a9accec511209f68890982 (patch) | |
tree | 18f9b22e63228e61a8f4187733afd28b535858a0 /src | |
parent | 982504452d60a87632a5a2f11d1be645e06d8346 (diff) | |
download | coreutils-5d0b158f4c7b7fa506a9accec511209f68890982.tar.xz |
seq: Fix equal width calculation when '.' added to last number
Issue reported by Samuel Hapák.
<http://lists.gnu.org/archive/html/bug-coreutils/2009-02/msg00139.html>
* src/seq.c: Account for '.' added to "last" number.
* tests/misc/seq: Add corresponding test.
* NEWS: Mention the fix.
Diffstat (limited to 'src')
-rw-r--r-- | src/seq.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -317,6 +317,8 @@ get_default_format (operand first, operand step, operand last) size_t last_width = last.width + (prec - last.precision); if (last.precision && prec == 0) last_width--; /* don't include space for '.' */ + if (last.precision == 0 && prec) + last_width++; /* include space for '.' */ size_t width = MAX (first_width, last_width); if (width <= INT_MAX) { |