diff options
Diffstat (limited to 'winsup/cygwin/dcrt0.cc')
-rw-r--r-- | winsup/cygwin/dcrt0.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc index a022c8305..a9679c90c 100644 --- a/winsup/cygwin/dcrt0.cc +++ b/winsup/cygwin/dcrt0.cc @@ -18,6 +18,7 @@ details. */ #include "exceptions.h" #include <ctype.h> #include <limits.h> +#include <winnls.h> #include <wingdi.h> #include <winuser.h> #include "sigproc.h" @@ -855,11 +856,10 @@ dll_crt0_1 (void *) if (!__argc) { - char *line = GetCommandLineA (); - line = strcpy ((char *) alloca (strlen (line) + 1), line); - - if (current_codepage == oem_cp) - CharToOemA (line, line); + PWCHAR wline = GetCommandLineW (); + size_t size = sys_wcstombs (NULL, size, wline); + char *line = (char *) alloca (size); + sys_wcstombs (line, size, wline); /* Scan the command line and build argv. Expand wildcards if not called from another cygwin process. */ |