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

@@ -1527,7 +1527,8 @@ internal_setlocale ()
if (cygheap->locale.mbtowc == __global_locale.mbtowc)
return;
debug_printf ("Cygwin charset chang to %s", __locale_charset ());
debug_printf ("Global charset set to %s",
__locale_charset (&__global_locale));
/* Fetch PATH and CWD and convert to wchar_t in previous charset. */
path = getenv ("PATH");
if (path && *path) /* $PATH can be potentially unset. */