bug#7877: sleep takes undocumented hex args

2011-01-28 Thread James Cloos
> "JM" == Jim Meyering writes: JM> I see no significant utility in accepting hex floats. Do you? JM> If you're concerned about errors in conversion or the efficiency JM> of the conversion process, then you probably don't want to use JM> the sleep command in the first place. the reason would

bug#7877: sleep takes undocumented hex args

2011-01-21 Thread Pádraig Brady
On 21/01/11 19:28, Jim Meyering wrote: > Paul Eggert wrote: >> On 01/21/2011 01:24 AM, Jim Meyering wrote: >>> My first reflex was to make sleep reject args like 0x... and inf. >> >> My reflex was just the opposite: why reject a notation >> that might be useful? > > I see that at least freebsd's /

bug#7877: sleep takes undocumented hex args

2011-01-21 Thread Jim Meyering
Paul Eggert wrote: > On 01/21/2011 01:24 AM, Jim Meyering wrote: >> My first reflex was to make sleep reject args like 0x... and inf. > > My reflex was just the opposite: why reject a notation > that might be useful? I see that at least freebsd's /bin/sleep and the one from sunos 5.11 work just li

bug#7877: sleep takes undocumented hex args

2011-01-21 Thread Paul Eggert
On 01/21/2011 01:24 AM, Jim Meyering wrote: > My first reflex was to make sleep reject args like 0x... and inf. My reflex was just the opposite: why reject a notation that might be useful? Several other programs (printf, seq, sort, tail, plus many other GNU programs) also use strtod or strtold.

bug#7877: sleep takes undocumented hex args

2011-01-21 Thread Eric Blake
On 01/21/2011 07:57 AM, Jim Meyering wrote: >> Floating point literals include hex-floats, such as 0x1p1. Does today's >> added pre-filtering to reject 0x1 accidentally also reject hex-float >> literals? (It's a bit of a shame that when hex-floats were added that >> strtod() was altered to accept

bug#7877: sleep takes undocumented hex args

2011-01-21 Thread Jim Meyering
Eric Blake wrote: > On 01/21/2011 06:03 AM, Jim Meyering wrote: >> jida...@jidanni.org wrote: >>> You see I was trying to make very special arguments to sleep so that I >>> can make sure to kill the one I want >>> pkill -u jidanni -fx sleep\ 22 >>> It is not clear if that will still work.

bug#7877: sleep takes undocumented hex args

2011-01-21 Thread Eric Blake
On 01/21/2011 06:03 AM, Jim Meyering wrote: > jida...@jidanni.org wrote: >> You see I was trying to make very special arguments to sleep so that I >> can make sure to kill the one I want >> pkill -u jidanni -fx sleep\ 22 >> It is not clear if that will still work. > > With today's change u

bug#7877: sleep takes undocumented hex args

2011-01-21 Thread Pádraig Brady
On 21/01/11 12:48, jida...@jidanni.org wrote: > You see I was trying to make very special arguments to sleep so that I > can make sure to kill the one I want > pkill -u jidanni -fx sleep\ 22 > It is not clear if that will still work. Maybe the man/info page should > say a regexp that matche

bug#7877: sleep takes undocumented hex args

2011-01-21 Thread Jim Meyering
jida...@jidanni.org wrote: > You see I was trying to make very special arguments to sleep so that I > can make sure to kill the one I want > pkill -u jidanni -fx sleep\ 22 > It is not clear if that will still work. With today's change using "sleep 22" will still act just like "sleep 22

bug#7877: sleep takes undocumented hex args

2011-01-21 Thread Jim Meyering
jida...@jidanni.org wrote: > You see I was trying to make very special arguments to sleep so that I > can make sure to kill the one I want > pkill -u jidanni -fx sleep\ 22 > It is not clear if that will still work. Maybe the man/info page should > say a regexp that matches all valid args.

bug#7877: sleep takes undocumented hex args

2011-01-21 Thread jidanni
You see I was trying to make very special arguments to sleep so that I can make sure to kill the one I want pkill -u jidanni -fx sleep\ 22 It is not clear if that will still work. Maybe the man/info page should say a regexp that matches all valid args.

bug#7877: sleep takes undocumented hex args

2011-01-21 Thread Jim Meyering
Voelker, Bernhard wrote: > Jim Meyering wrote: >> That's an artifact of GNU sleep using strtod, which means "inf" and >> "INFINITY" are also accepted: >> >> $ timeout 1 sleep inf >> [Exit 124] > > what's wrong with `sleep inf`? Hi Volker, There's nothing terribly _wrong_ with it, but I am

bug#7877: sleep takes undocumented hex args

2011-01-21 Thread Jim Meyering
Pádraig Brady wrote: > On 21/01/11 09:24, Jim Meyering wrote: >> +return false; >> + return ISDIGIT (*p) || *p == '.'; >> +} > > looks good. Perhaps rename to c_strtod_pre_filter() > as I initially wondered why you hardcoded '.' Good idea. Done. Thanks for the quick review.

bug#7877: sleep takes undocumented hex args

2011-01-21 Thread Voelker, Bernhard
Jim Meyering wrote: > That's an artifact of GNU sleep using strtod, which means "inf" and > "INFINITY" are also accepted: > > $ timeout 1 sleep inf > [Exit 124] what's wrong with `sleep inf`? Have a nice day, Berny

bug#7877: sleep takes undocumented hex args

2011-01-21 Thread Pádraig Brady
On 21/01/11 09:24, Jim Meyering wrote: > +return false; > + return ISDIGIT (*p) || *p == '.'; > +} looks good. Perhaps rename to c_strtod_pre_filter() as I initially wondered why you hardcoded '.' cheers, Pádraig.

bug#7877: sleep takes undocumented hex args

2011-01-21 Thread Jim Meyering
jida...@jidanni.org wrote: > The documentation doesn't say that one can also use hex args: > $ time /bin/sleep 0x10 > real0m16.007s > However not octal args: > $ time /bin/sleep 010 > real0m10.003s Interesting. Thanks for the report. That's an artifact of GNU sleep using strtod, which mea

bug#7877: sleep takes undocumented hex args

2011-01-20 Thread jidanni
The documentation doesn't say that one can also use hex args: $ time /bin/sleep 0x10 real0m16.007s However not octal args: $ time /bin/sleep 010 real0m10.003s Maybe say how too.