* cygheap.h (cwdstuff): Convert to class. Make posix and dir private.

(cwdstuff::get_posix): New method.
	(cwdstuff::reset_posix): New method.
	* dcrt0.cc (dll_crt0_1): Call setlocale rather than _setlocale_r.
	* environ.cc (environ_init): Ditto.  Prefer "C" locale over current
	codepage default locale.
	* path.cc (chdir): Use cwdstuff::get_posix method instead of accessing
	cwdstuff::posix directly.
	(cwdstuff::set): Defer creating posix path to first usage.
	(cwdstuff::get_posix): Create posix path if it's empty, and return it.
	(cwdstuff::get): Create posix path if it's empty.
	* strfuncs.cc (sys_cp_wcstombs): Use UTF-8 conversion in the "C"
	locale.
	(sys_cp_mbstowcs): Ditto.
	* syscalls.cc (gen_full_path_at): Fetch CWD posix path locked.
	(setlocale): Implement here.  Reset CWD posix path.
This commit is contained in:
Corinna Vinschen
2009-05-13 15:00:06 +00:00
parent 136033a852
commit b6c6ea43f3
7 changed files with 75 additions and 11 deletions

View File

@@ -931,7 +931,7 @@ dll_crt0_1 (void *)
LoadLibrary serialization. */
ld_preload ();
/* Reset current locale to "C" per POSIX */
_setlocale_r (_GLOBAL_REENT, LC_CTYPE, "C");
setlocale (LC_CTYPE, "C");
if (user_data->main)
cygwin_exit (user_data->main (__argc, __argv, *user_data->envptr));
__asm__ (" \n\