ctype tables incorrectly setup

Nick Burrett nick at dsvr.net
Sat Jan 12 08:16:01 PST 2002


Alex Waugh <alex at alexwaugh.com> writes:

> The __ctype_lower and __ctype_upper tables are currently being
> initialised to zero, so in the C/POSIX locale
> tolower('top bit set char') returns 0 rather than returning the
> character unchanged. The following patch fixes this.

Thanks. Committed.

Nick.

 
> 
> Index: unixlib/source/locale/ctypetable.c
> ===================================================================
> RCS file: /usr/local/cvsroot/gccsdk/unixlib/source/locale/ctypetable.c,v
> retrieving revision 1.2.2.2
> diff -u -r1.2.2.2 ctypetable.c
> --- unixlib/source/locale/ctypetable.c	2001/09/04 16:32:04	1.2.2.2
> +++ unixlib/source/locale/ctypetable.c	2001/12/30 20:37:40
> @@ -35,7 +35,7 @@
>    for (x = 0; x <= 255; x++)
>      {
>        __ctype[x] = 0;
> -      __ctype_lower[x] = __ctype_upper[x] = 0;
> +      __ctype_lower[x] = __ctype_upper[x] = x;
>      }
>  
>    /* Support EOF.  This is not a bug, the arrays must
> 
> 
> Cheers
> 
> Alex
> 
> -- 
> Alex Waugh                               alex at alexwaugh.com
> 
> PHP, Roots, WebJames and more from http://www.alexwaugh.com/



More information about the gcc mailing list