Introduce __current_locale_charset/__locale_charset

The former __locale_charset always fetched the current locale's charset.
We need the per-locale charset, too, in future. Rename __locale_charset
to __current_locale_charset and change __locale_charset to take a
locale_t as parameter.  Accommodate througout.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen
2016-08-20 16:05:56 +02:00
parent 06ac671811
commit 7630e38462
5 changed files with 19 additions and 8 deletions

View File

@ -1132,7 +1132,7 @@ wgetnext(struct parse *p)
invalid ASCII chars. To be more Linux-compatible, we align the
behaviour to glibc here. Allow any character value if the current
local's codeset is ASCII. */
if (*__locale_charset () == 'A') /* SCII */
if (*__current_locale_charset () == 'A') /* SCII */
return (wint_t) (unsigned char) *p->next++;
#endif
memset(&mbs, 0, sizeof(mbs));
@ -1503,7 +1503,7 @@ findmust(struct parse *p, struct re_guts *g)
*/
if (MB_CUR_MAX > 1 &&
#ifdef __CYGWIN__
strcmp(__locale_charset (), "UTF-8") != 0)
strcmp(__current_locale_charset (), "UTF-8") != 0)
#else
strcmp(_CurrentRuneLocale->__encoding, "UTF-8") != 0)
#endif