Source-Changes-D archive

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

Re: CVS commit: src/lib/libc/locale



I can' t understand why this change is needed.

POSIX2008 spec say, *_l func with invalid locale handle may EINVAL.
NULL or (locale_t)0 is invalid locale handle.
why are you think fallback to C locale?

http://pubs.opengroup.org/onlinepubs/9699919799/functions/isalpha.html
http://pubs.opengroup.org/onlinepubs/9699919799/functions/nl_langinfo.html
http://pubs.opengroup.org/onlinepubs/9699919799/functions/newlocale.html

glibc2(*_l function's origin) does more simpler, they don't check NULL
and cause Segmentation Fault.
I think glibc2 is reasonable, because POSIX2008  does change for the worse.
as far as is*_l functions, return value is non-zero(=matches class) or
zero(=not matches class) only.
we can't know the error from it.


2013/4/15 Joerg Sonnenberger <joerg%netbsd.org@localhost>:
> Module Name:    src
> Committed By:   joerg
> Date:           Sun Apr 14 23:44:54 UTC 2013
>
> Modified Files:
>         src/lib/libc/locale: Makefile.inc setlocale_local.h
> Added Files:
>         src/lib/libc/locale: c_locale.c
>
> Log Message:
> Provide a const copy of global_locale for libc-internal use.
> This will be used by *_l when a NULL pointer is given.
>
>
> To generate a diff of this commit:
> cvs rdiff -u -r1.60 -r1.61 src/lib/libc/locale/Makefile.inc
> cvs rdiff -u -r0 -r1.1 src/lib/libc/locale/c_locale.c
> cvs rdiff -u -r1.10 -r1.11 src/lib/libc/locale/setlocale_local.h
>
> Please note that diffs are not public domain; they are subject to the
> copyright notices on the relevant files.
>

--
Takehiko NOZAKI<takehiko.nozaki%gmail.com@localhost>


Home | Main Index | Thread Index | Old Index