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.
Even with this patch, on some systems, it still produces invalid output,
from 3 to at least 1026 lines long. [bug introduced in coreutils-6.11]
+ seq -w now accounts for a decimal point added to the last number
+ to correctly print all numbers to the same width.
+
wc --files0-from=FILE no longer reads all of FILE into RAM, before
processing the first file name, unless the list of names is known
to be small enough.
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)
{
['eq-wid-5', qw(-w 1 .5 2), {OUT => [qw(1.0 1.5 2.0)]}],
['eq-wid-6', qw(-w +1 2), {OUT => [qw(1 2)]}],
['eq-wid-7', qw(-w " .1" " .1"), {OUT => [qw(0.1)]}],
+ ['eq-wid-8', qw(-w 9 0.5 10), {OUT => [qw(09.0 09.5 10.0)]}],
# Prior to coreutils-4.5.11, some of these were not accepted.
['fmt-1', qw(-f %2.1f 1.5 .5 2),{OUT => [qw(1.5 2.0)]}],