Subject: Re: locale ctype corrections
To: None <th-nozaki@netwrk.co.jp>
From: T.SHIOZAKI <tshiozak@astec.co.jp>
List: tech-userlevel
Date: 03/08/2005 16:39:41
> > I'm not sure which is the best place to post this,
> > but the attached patch fixes some bugs in the ctype
> > sources.
> 
> it seems that the bug affect isxdigit(3) only,
> because isxdigit(3) checking 'digit' or 'xdigit'
> 
> (snip)
> src/include/ctype.h
> #define isxdigit(c)     ((int)((_ctype_ + 1)[(c)] & (_N|_X)))
> (snip)
> 
> so that, i think it's better to change iswxdigit(3) than LC_CTYPE.
> 
> (snip)
> Index: iswctype.c
> ===================================================================
> RCS file: /cvsroot/src/lib/libc/locale/iswctype.c,v
> retrieving revision 1.15
> diff -u -r1.15 iswctype.c
> --- iswctype.c  9 Feb 2005 21:35:46 -0000       1.15
> +++ iswctype.c  8 Mar 2005 05:58:08 -0000
> @@ -189,7 +189,7 @@
>  iswxdigit(c)
>         wint_t c;
>  {
> -       return (__isctype_w((c), _CTYPE_X));
> +       return (__isctype_w((c), _CTYPE_D | _CTYPE_X));
>  }
> 
>  #undef towupper
> 
> comments?

In the architectural view, isw?xdigit(c) is not always true when
isw?digit(c) is true, because SUSv3 defines 'digit' class and
'xdigit' class individually.  ctype.h would rathar be changed than
iswctype.c.  The current ctype.h (derived from 4.3BSD) is not
sufficient to conform to SUS and we need to overhaul ctype.h.


--
Takuya SHIOZAKI