On Fri, Jan 25, 2019 at 10:43:10 +0700, Robert Elz wrote: > Date: Thu, 24 Jan 2019 16:18:49 +0100 > From: Joerg Sonnenberger <jo...@bec.de> > Message-ID: <20190124151849.ga10...@britannica.bec.de> > > | This is overcomplicated and fragile, IMO. Can we just go back to the old > | code and switch the strtod to strtod_l with LC_C_LOCALE? That solves the > | input problem. > > We could certainly do that, but while it is a little complicated, I do not > really think it is fragile. Using a locale specific decimal radix in a > script is fragile - but the only way to avoid that is either to effectively > give up on non-C locales entirely for scripts, or drop all support for > fractional numbers as args to any command. > > Note: the arg to "sleep" might come as ... > echo -n "How many seconds do you want to sleep? " > read secs > sleep "${secs}" > (with some error checking). > > I have no idea why sleep() was made to parse its arg in a locale > specific way, but that was done long long ago, and was (according > to the comments) done quite deliberately. > > I think changing that decison (rather than just avoiding the problem, > as the current "fix" does) needs more discussion than a few comments > on the source-changes-d list.
As someone who actually have to ecnoutner locales in daily life and not just think about them sitting in an ivory tower I don't understand why do we even have this argument. Locale-specific argument to sleep is pure madness, period (no pun intended). -uwe