bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] inet_pton.c: use locale-independent tolower


From: Simon Josefsson
Subject: Re: [PATCH] inet_pton.c: use locale-independent tolower
Date: Wed, 06 Aug 2008 12:24:22 +0200
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.2 (gnu/linux)

Jim Meyering <address@hidden> writes:

> Hi Simon,
>
> I'd like to make this change, so that inet_pton's parsing is
> locale-independent.  No real risk of problem, but this change does get me
> past a failure of a relatively strict "make syntax-check" test in libvirt.
> And besides, we certainly don't need locale-related conversions to map
> A-F to a-f.
>
> Ok to commit?

Hi!  Looks fine to me.  It would be a diversion from upstream glibc, but
I don't care strongly.

Thanks,
/Simon

> From 89623ce67af5f348d3785596ec7eed5bfc9942c1 Mon Sep 17 00:00:00 2001
> From: Jim Meyering <address@hidden>
> Date: Wed, 6 Aug 2008 11:49:11 +0200
> Subject: [PATCH] inet_pton.c: use locale-independent tolower
>
> * lib/inet_pton.c: Include <c-ctype.h> rather than <ctype.h>.
> (inet_pton6): Use c_tolower rather than tolower.
> * modules/inet_pton (Depends-on): Add c-ctype.
> ---
>  lib/inet_pton.c   |    4 ++--
>  modules/inet_pton |    1 +
>  2 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/lib/inet_pton.c b/lib/inet_pton.c
> index 261caf1..62ef145 100644
> --- a/lib/inet_pton.c
> +++ b/lib/inet_pton.c
> @@ -37,7 +37,7 @@
>  /* Specification.  */
>  #include <arpa/inet.h>
>
> -#include <ctype.h>
> +#include <c-ctype.h>
>  #include <string.h>
>  #include <errno.h>
>
> @@ -179,7 +179,7 @@ inet_pton6 (const char *restrict src, unsigned char 
> *restrict dst)
>    curtok = src;
>    saw_xdigit = 0;
>    val = 0;
> -  while ((ch = tolower (*src++)) != '\0')
> +  while ((ch = c_tolower (*src++)) != '\0')
>      {
>        const char *pch;
>
> diff --git a/modules/inet_pton b/modules/inet_pton
> index deafb60..173710a 100644
> --- a/modules/inet_pton
> +++ b/modules/inet_pton
> @@ -6,6 +6,7 @@ lib/inet_pton.c
>  m4/inet_pton.m4
>
>  Depends-on:
> +c-ctype
>  socklen
>  sys_socket
>  arpa_inet
> --
> 1.6.0.rc1.74.ga559e




reply via email to

[Prev in Thread] Current Thread [Next in Thread]