after some long hard thought i decided to not use the broken cmd version
of CommandLineToArgvW and start using the less broken ros api version.
This doesnt matter all that much as cmd isnt compiled as unicode(yet).
Modified: trunk/reactos/subsys/system/cmd/cmd.c
_____
Modified: trunk/reactos/subsys/system/cmd/cmd.c
--- trunk/reactos/subsys/system/cmd/cmd.c 2005-10-19 02:53:03 UTC
(rev 18589)
+++ trunk/reactos/subsys/system/cmd/cmd.c 2005-10-19 13:12:01 UTC
(rev 18590)
@@ -1716,53 +1716,6 @@
}
}
-#ifdef __REACTOS__
-#ifdef _UNICODE
-PWCHAR * _CommandLineToArgvW(PWCHAR lpCmdLine, int *pNumArgs)
-{
- PWCHAR * argvw = NULL;
- PWCHAR ptr = lpCmdLine;
- PWCHAR str;
- int len;
- int NumArgs;
-
- NumArgs = 0;
-
- while(lpCmdLine && *lpCmdLine)
- {
- while (iswspace(*lpCmdLine)) lpCmdLine++;
- if (*lpCmdLine)
- {
- if ((NumArgs % 10)==0)
- {
- PWCHAR * old_argvw = argvw;
- argvw = malloc((NumArgs + 10) *
sizeof(PWCHAR));
- memcpy(argvw, old_argvw, NumArgs *
sizeof(PWCHAR));
- free(old_argvw);
- }
- ptr = wcschr(lpCmdLine, L' ');
- if (ptr)
- {
- len = ptr - lpCmdLine;
- }
- else
- {
- len = wcslen(lpCmdLine);
- }
- str = malloc((len + 1) * sizeof(WCHAR));
- memcpy(str, lpCmdLine, len * sizeof(WCHAR));
- str[len] = 0;
- argvw[NumArgs]=str;
- NumArgs++;
- lpCmdLine = ptr;
- }
- }
- *pNumArgs = NumArgs;
- return argvw;
-}
-#endif
-#endif
-
/*
* main function
*/
@@ -1778,12 +1731,8 @@
#ifdef _UNICODE
PWCHAR * argv;
int argc=0;
-#ifdef __REACTOS__
- argv = _CommandLineToArgvW(GetCommandLineW(), &argc);
-#else
argv = CommandLineToArgvW(GetCommandLineW(), &argc);
#endif
-#endif
GetCurrentDirectory(MAX_PATH,startPath);
_tchdir(startPath);
Show replies by date