Overview
| Artifact ID: | d2d8ea56d9cefeb11eba1d009646c9a23a950b1f |
|---|---|
| Ticket: | 528669ffffffffffffffffffffffffffffffffff |
| Date: | 2002-03-12 05:11:51 |
| User: | davygrvy |
| Artifact Attached: | df3c761b246c85bd41343d34e31588be1f19adaf |
| Filename: | patch.txt |
| Description: | changes to win/tclAppInit.c |
Content:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45Index: tclAppInit.c =================================================================== RCS file: /cvsroot/tcl/tcl/win/tclAppInit.c,v retrieving revision 1.8 diff -c -r1.8 tclAppInit.c *** tclAppInit.c 21 Feb 2002 21:20:08 -0000 1.8 --- tclAppInit.c 11 Mar 2002 22:06:47 -0000 *************** *** 218,225 **** char *cmdLine, *p, *arg, *argSpace; char **argv; int argc, size, inquote, copy, slashes; ! cmdLine = GetCommandLine(); /* INTL: BUG */ /* * Precompute an overly pessimistic guess at the number of arguments --- 218,236 ---- char *cmdLine, *p, *arg, *argSpace; char **argv; int argc, size, inquote, copy, slashes; + WCHAR *cmdLineUni; + + cmdLineUni = GetCommandLineW(); ! /* calculate the size needed. */ ! size = WideCharToMultiByte(CP_OEMCP, 0, cmdLineUni, -1, 0, 0, NULL, NULL); ! cmdLine = Tcl_Alloc(size); ! ! /* INTL: BUG */ ! /* We should replace the conversion with CP_UTF8, but Tcl_Main() expects ! * argv to be dirty. So we can't clean it here. This, thus, creates a ! * unicode loss. */ ! WideCharToMultiByte(CP_OEMCP, 0, cmdLineUni, -1, cmdLine, size, NULL, NULL); /* * Precompute an overly pessimistic guess at the number of arguments *************** *** 298,301 **** --- 309,313 ---- *argcPtr = argc; *argvPtr = argv; + Tcl_Free(cmdLine); }