vapier 15/04/25 00:46:38 Added: iputils-20121221-strtod.patch Log: Fix -i number parsing in some locales #472592 by Sergey Fionov. (Portage version: 2.2.18/cvs/Linux x86_64, signed Manifest commit with key D2E96200)
Revision Changes Path 1.1 net-misc/iputils/files/iputils-20121221-strtod.patch file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/iputils/files/iputils-20121221-strtod.patch?rev=1.1&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/iputils/files/iputils-20121221-strtod.patch?rev=1.1&content-type=text/plain Index: iputils-20121221-strtod.patch =================================================================== https://bugs.gentoo.org/472592 >From dd0aa192626f94d08e399fc2a743ee72c50853fb Mon Sep 17 00:00:00 2001 From: Mike Frysinger <[email protected]> Date: Fri, 24 Apr 2015 20:41:31 -0400 Subject: [PATCH iputils] ping: fix -i number parsing in locales Always use #.# format for the -i flag even when the current locale uses a different separator. Locale de_DE which uses #,# normally. Simple testcase: $ make USE_IDN=1 $ LANG=de_DE.UTF8 ./ping -i 0.5 localhost Reported-by: Sergey Fionov <[email protected]> Signed-off-by: Mike Frysinger <[email protected]> --- ping_common.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ping_common.c b/ping_common.c index 62f53a6..0a37e09 100644 --- a/ping_common.c +++ b/ping_common.c @@ -269,9 +269,17 @@ void common_options(int ch) double dbl; char *ep; +#ifdef USE_IDN + setlocale(LC_ALL, "C"); +#endif + errno = 0; dbl = strtod(optarg, &ep); +#ifdef USE_IDN + setlocale(LC_ALL, ""); +#endif + if (errno || *ep != '\0' || !finite(dbl) || dbl < 0.0 || dbl >= (double)INT_MAX / 1000 - 1.0) { fprintf(stderr, "ping: bad timing interval\n"); -- 2.3.5
