[WSCRIPT]
authorThomas Faber <thomas.faber@reactos.org>
Tue, 31 Mar 2015 18:30:02 +0000 (18:30 +0000)
committerThomas Faber <thomas.faber@reactos.org>
Tue, 31 Mar 2015 18:30:02 +0000 (18:30 +0000)
- Correctly use CommandLineToArgvW. Fixes cscript crashing on start.
CORE-9439 #resolve

svn path=/trunk/; revision=67001

reactos/base/applications/cmdutils/wscript/main.c

index f8f6122..568d090 100644 (file)
@@ -412,11 +412,11 @@ int WINAPI wWinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPWSTR cmdline, int cm
 
     WINE_TRACE("(%p %p %s %x)\n", hInst, hPrevInst, wine_dbgstr_w(cmdline), cmdshow);
 
-    argv = CommandLineToArgvW(cmdline, &argc);
+    argv = CommandLineToArgvW(GetCommandLineW(), &argc);
     if(!argv)
         return 1;
 
-    for(i=0; i<argc; i++) {
+    for(i=1; i<argc; i++) {
         if(*argv[i] == '/' || *argv[i] == '-') {
             if(!set_host_properties(argv[i]))
                 return 1;