public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: YOSHIFUJI Hideaki <hideaki.yoshifuji@miraclelinux•com>
To: Mike Frysinger <vapier@gentoo•org>,
	YOSHIFUJI Hideaki <yoshfuji@linux-ipv6•org>
Cc: hideaki.yoshifuji@miraclelinux•com, netdev@vger•kernel.org
Subject: Re: [PATCH iputils 6/6] ping: fix -i number parsing in locales
Date: Thu, 2 Jun 2016 11:08:25 +0900	[thread overview]
Message-ID: <574F9519.5050400@miraclelinux.com> (raw)
In-Reply-To: <1464752905-10347-6-git-send-email-vapier@gentoo.org>



Mike Frysinger wrote:
> 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 <fionov@gmail•com>
> Signed-off-by: Mike Frysinger <vapier@gentoo•org>
> ---
>  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");
> 

Please make it accept both.

-- 
Hideaki Yoshifuji <hideaki.yoshifuji@miraclelinux•com>
Technical Division, MIRACLE LINUX CORPORATION

  reply	other threads:[~2016-06-02  2:08 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-01  3:48 [PATCH iputils 1/6] start gitignore files Mike Frysinger
2016-06-01  3:48 ` [PATCH iputils 2/6] doc: fix parallel build of html/man pages Mike Frysinger
2016-06-02  2:39   ` YOSHIFUJI Hideaki
2016-06-01  3:48 ` [PATCH iputils 3/6] ping6: allow disabling of openssl support Mike Frysinger
2016-06-02  2:04   ` YOSHIFUJI Hideaki
2016-06-02  4:59   ` [PATCH iputils v2] ping6: allow disabling of openssl/libgcrypt support Mike Frysinger
2016-06-02  8:49     ` YOSHIFUJI Hideaki
2016-06-02 13:38       ` Mike Frysinger
2016-06-02 17:16     ` [PATCH iputils v3] " Mike Frysinger
2016-06-01  3:48 ` [PATCH iputils 4/6] fix handling of CFLAGS Mike Frysinger
2016-06-02  2:35   ` YOSHIFUJI Hideaki
2016-06-01  3:48 ` [PATCH iputils 5/6] tftpd: fix syslog setup Mike Frysinger
2016-06-02  2:10   ` YOSHIFUJI Hideaki
2016-06-02  4:33     ` Mike Frysinger
2016-06-02  8:31       ` YOSHIFUJI Hideaki
2016-06-01  3:48 ` [PATCH iputils 6/6] ping: fix -i number parsing in locales Mike Frysinger
2016-06-02  2:08   ` YOSHIFUJI Hideaki [this message]
2016-06-02  4:46   ` [PATCH iputils v2] ping: always accept . delimiter with -i number parsing Mike Frysinger
2016-06-02  8:28     ` YOSHIFUJI Hideaki
2016-06-02  2:06 ` [PATCH iputils 1/6] start gitignore files YOSHIFUJI Hideaki
2016-06-02  4:42   ` Mike Frysinger
2016-06-02  8:57     ` YOSHIFUJI Hideaki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=574F9519.5050400@miraclelinux.com \
    --to=hideaki.yoshifuji@miraclelinux$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=vapier@gentoo$(echo .)org \
    --cc=yoshfuji@linux-ipv6$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox