1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-04-21 11:16:16 +02:00

seq: fix incorrect output with start or end of -0

* src/seq.c (main): Avoid seq_fast() with a start or end of -0.
* tests/misc/seq.pl: Add test cases.
* NEWS: Mention the fix.
Fixes http://bugs.gnu.org/17800
This commit is contained in:
Pádraig Brady
2014-06-18 14:30:57 +01:00
parent 8a51bd3736
commit 5ad16c2a0f
3 changed files with 7 additions and 1 deletions

View File

@@ -604,7 +604,7 @@ main (int argc, char **argv)
if (asprintf (&s2, "%0.Lf", last.value) < 0)
xalloc_die ();
if (seq_fast (s1, s2))
if (*s1 != '-' && *s2 != '-' && seq_fast (s1, s2))
{
IF_LINT (free (s1));
IF_LINT (free (s2));