* autoload.cc: Autoload CharToOemA.

* dcrt0.cc (dll_crt0_1): Translate command line to OEM if current codepage is
OEM.
* environ.cc: Add new option 'codepage' to CYGWIN environment variable.
* fhandler_clipboard.cc (fhandler_clipboard::read): Read clipboard in OEM mode
if current codepage is OEM.
* fhandler_console.cc (fhandler_console::read): Only translate console input if
current codepage is ANSI.
* fhandler_console.cc (fhandler_console::write_normal): Translate output data
if current codepage is ANSI.
* pinfo.cc (codepage_init): New function.  Setup current codepage from CYGWIN
environment variable and set codepage for file APIs.
* security.cc (read_sd): Translate file name to it if current codepage is OEM.
* winsup.h: (sys_wcstombs,sys_mbstowcs): Use current codepage for translations
between multibyte and widechar string and vice versa.
This commit is contained in:
Christopher Faylor
2000-12-10 00:45:12 +00:00
parent 307cb8ba82
commit ee1d77e4b7
9 changed files with 100 additions and 48 deletions

View File

@@ -15,6 +15,8 @@ details. */
#include "exceptions.h"
#include <ctype.h>
#include <limits.h>
#include <wingdi.h>
#include <winuser.h>
#include "sync.h"
#include "sigproc.h"
#include "pinfo.h"
@@ -55,6 +57,7 @@ per_thread NO_COPY *threadstuff[] = {&waitq_storage,
BOOL display_title = FALSE;
BOOL strip_title_path = FALSE;
BOOL allow_glob = TRUE;
codepage_type current_codepage = ansi_cp;
int cygwin_finished_initializing = 0;
@@ -789,6 +792,9 @@ dll_crt0_1 ()
char *line = GetCommandLineA ();
line = strcpy ((char *) alloca (strlen (line) + 1), line);
if (current_codepage == oem_cp)
CharToOemA ( line, line );
/* Scan the command line and build argv. Expand wildcards if not
called from another cygwin process. */
build_argv (line, __argv, __argc,