bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug#208494: coreutils: seq -w doesn't work properly with two negativ


From: Jim Meyering
Subject: Re: Bug#208494: coreutils: seq -w doesn't work properly with two negative values
Date: Wed, 03 Sep 2003 13:33:58 +0200

Patrick Mauritz <address@hidden> wrote:
> Package: coreutils
> Version: 5.0.90-3
> Severity: normal
>
> seq -w 0 -11 returns
> 000
> -01
> ...
> -11
>
> while
> seq -w -4 -11 returns
> -4
> -5
> ..
> -11
>
> the latter doesn't seem to be correct

Thanks for the report!
I'll look more closely at it later.
In the mean time, here's a tentative patch:

Index: src/seq.c
===================================================================
RCS file: /fetish/cu/src/seq.c,v
retrieving revision 1.71
diff -u -p -u -p -r1.71 seq.c
--- src/seq.c   23 Jul 2003 07:29:55 -0000      1.71
+++ src/seq.c   3 Sep 2003 09:44:34 -0000
@@ -259,7 +259,7 @@ get_width_format ()
     }
 
   sprintf (buffer, "%g", rint (max_val));
-  if (buffer[strspn (buffer, "0123456789")] != '\0')
+  if (buffer[strspn (buffer, "-0123456789")] != '\0')
     return "%g";
   width1 = strlen (buffer);
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]