GNU bug report logs - #17800
seq weirdness with -0

Previous Next

Package: coreutils;

Reported by: Rasmus Villemoes <rv <at> rasmusvillemoes.dk>

Date: Wed, 18 Jun 2014 11:57:03 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Pádraig Brady <P <at> draigBrady.com>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#17800: closed (seq weirdness with -0)
Date: Wed, 18 Jun 2014 13:40:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Wed, 18 Jun 2014 14:39:03 +0100
with message-id <53A19677.1080307 <at> draigBrady.com>
and subject line Re: bug#17800: seq weirdness with -0
has caused the debbugs.gnu.org bug report #17800,
regarding seq weirdness with -0
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
17800: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17800
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Rasmus Villemoes <rv <at> rasmusvillemoes.dk>
To: bug-coreutils <at> gnu.org
Subject: seq weirdness with -0
Date: Wed, 18 Jun 2014 11:41:43 +0200
$ ./seq --version | head -1
seq (GNU coreutils) 8.22.119-8a51b

./seq -0 n works fine when n is a single digit:

$ ./seq --separator=, -0 5
-0,1,2,3,4,5

But something weird happens when one uses a number >= 10:

$ ./seq --separator=, -0 10
-0,-1,-2,-3,-4,-5,-6,-7,-8,-9,.0,.1,.2,.3,.4,.5,.6,.7,.8,.9,/0,/1,/2,/3,/4,/5,/6,/7,/8,/9,00,01,02,03,04,05,06,07,08,09,10

[It also happens without the --separator; I just use that to save
vertical space.] This smells of ASCII, and looking at the code, the
problem is very likely to be the seq_fast/incr functions. I don't know
what the simplest fix is, though.

Rasmus



[Message part 3 (message/rfc822, inline)]
From: Pádraig Brady <P <at> draigBrady.com>
To: Rasmus Villemoes <rv <at> rasmusvillemoes.dk>
Cc: 17800-done <at> debbugs.gnu.org
Subject: Re: bug#17800: seq weirdness with -0
Date: Wed, 18 Jun 2014 14:39:03 +0100
[Message part 4 (text/plain, inline)]
On 06/18/2014 01:03 PM, Pádraig Brady wrote:
> On 06/18/2014 10:41 AM, Rasmus Villemoes wrote:
>> $ ./seq --version | head -1
>> seq (GNU coreutils) 8.22.119-8a51b
>>
>> ./seq -0 n works fine when n is a single digit:
>>
>> $ ./seq --separator=, -0 5
>> -0,1,2,3,4,5
>>
>> But something weird happens when one uses a number >= 10:
>>
>> $ ./seq --separator=, -0 10
>> -0,-1,-2,-3,-4,-5,-6,-7,-8,-9,.0,.1,.2,.3,.4,.5,.6,.7,.8,.9,/0,/1,/2,/3,/4,/5,/6,/7,/8,/9,00,01,02,03,04,05,06,07,08,09,10
>>
>> [It also happens without the --separator; I just use that to save
>> vertical space.] This smells of ASCII, and looking at the code, the
>> problem is very likely to be the seq_fast/incr functions. I don't know
>> what the simplest fix is, though.
> 
> Ouch. I see the issue. Fix on the way...

Fast path avoidance logic updated in the attached.

thanks!
Pádraig.

[seq-0.patch (text/x-patch, attachment)]

This bug report was last modified 11 years and 34 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.