Index: environ.cc =================================================================== RCS file: /cvs/src/src/winsup/cygwin/environ.cc,v retrieving revision 1.50 diff -u -p -2 -r1.50 environ.cc --- environ.cc 2001/05/11 03:27:22 1.50 +++ environ.cc 2001/06/11 20:07:17 @@ -424,4 +424,19 @@ check_case_init (const char *buf) } +void +set_file_api_mode (codepage_type cp) +{ + if (cp == oem_cp) + { + SetFileApisToOEM (); + debug_printf ("File APIs set to OEM"); + } + else if (cp == ansi_cp) + { + SetFileApisToANSI (); + debug_printf ("File APIs set to ANSI"); + } +} + static void codepage_init (const char *buf) @@ -433,12 +448,10 @@ codepage_init (const char *buf) { current_codepage = oem_cp; - SetFileApisToOEM (); - debug_printf ("File APIs set to OEM"); + set_file_api_mode (current_codepage); } else if (strcmp (buf, "ansi")== 0) { current_codepage = ansi_cp; - SetFileApisToANSI (); - debug_printf ("File APIs set to ANSI"); + set_file_api_mode (current_codepage); } else Index: fork.cc =================================================================== RCS file: /cvs/src/src/winsup/cygwin/fork.cc,v retrieving revision 1.47 diff -u -p -2 -r1.47 fork.cc --- fork.cc 2001/05/20 01:19:20 1.47 +++ fork.cc 2001/06/11 20:07:17 @@ -272,4 +272,6 @@ fork_child (HANDLE& hParent, dll *&first } + set_file_api_mode (current_codepage); + MALLOC_CHECK; Index: winsup.h =================================================================== RCS file: /cvs/src/src/winsup/cygwin/winsup.h,v retrieving revision 1.56 diff -u -p -2 -r1.56 winsup.h --- winsup.h 2001/05/04 21:02:15 1.56 +++ winsup.h 2001/06/11 20:07:30 @@ -163,4 +163,6 @@ extern "C" void error_start_init (const extern "C" int try_to_debug (bool waitloop = 1); +void set_file_api_mode (codepage_type); + extern int cygwin_finished_initializing;