Commit in reactos on MAIN
lib/kernel32/process/create.c+3-21.82 -> 1.83
lib/msvcrt/misc/dllmain.c+5-51.20 -> 1.21
subsys/system/cmd/cmd.c+12-131.12 -> 1.13
+20-20
3 modified files
Fix command line handling (mostly double-quoting stuff)

reactos/lib/kernel32/process
create.c 1.82 -> 1.83
diff -u -r1.82 -r1.83
--- create.c	1 May 2004 18:09:53 -0000	1.82
+++ create.c	11 May 2004 20:44:29 -0000	1.83
@@ -1,4 +1,4 @@
-/* $Id: create.c,v 1.82 2004/05/01 18:09:53 tamlin Exp $
+/* $Id: create.c,v 1.83 2004/05/11 20:44:29 gvg Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
@@ -871,6 +871,7 @@
      {
         return FALSE;
      }
+   DPRINT("TidyCmdLine '%S'\n", TidyCmdLine);
 
    if (lpApplicationName != NULL && lpApplicationName[0] != 0)
      {
@@ -977,7 +978,7 @@
     * Process the application name and command line
     */
    RtlInitUnicodeString(&ImagePathName_U, ImagePathName);
-   RtlInitUnicodeString(&CommandLine_U, lpCommandLine);
+   RtlInitUnicodeString(&CommandLine_U, TidyCmdLine);
 
    DPRINT("ImagePathName_U %S\n", ImagePathName_U.Buffer);
    DPRINT("CommandLine_U %S\n", CommandLine_U.Buffer);

reactos/lib/msvcrt/misc
dllmain.c 1.20 -> 1.21
diff -u -r1.20 -r1.21
--- dllmain.c	31 Jan 2004 13:29:19 -0000	1.20
+++ dllmain.c	11 May 2004 20:44:30 -0000	1.21
@@ -1,4 +1,4 @@
-/* $Id: dllmain.c,v 1.20 2004/01/31 13:29:19 navaraf Exp $
+/* $Id: dllmain.c,v 1.21 2004/05/11 20:44:30 gvg Exp $
  *
  * dllmain.c
  *
@@ -14,9 +14,9 @@
  *  DISCLAMED. This includes but is not limited to warrenties of
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  *
- * $Revision: 1.20 $
- * $Author: navaraf $
- * $Date: 2004/01/31 13:29:19 $
+ * $Revision: 1.21 $
+ * $Author: gvg $
+ * $Date: 2004/05/11 20:44:30 $
  *
  */
 
@@ -90,7 +90,7 @@
         if (!CreateThreadData())
             return FALSE;
 
-        _acmdln = (char *)GetCommandLineA();
+        _acmdln = strdup(GetCommandLineA());
 
         /* FIXME: This crashes all applications */
         if (BlockEnvToEnviron() < 0)

reactos/subsys/system/cmd
cmd.c 1.12 -> 1.13
diff -u -r1.12 -r1.13
--- cmd.c	30 Apr 2004 16:52:41 -0000	1.12
+++ cmd.c	11 May 2004 20:44:30 -0000	1.13
@@ -1,4 +1,4 @@
-/* $Id: cmd.c,v 1.12 2004/04/30 16:52:41 navaraf Exp $
+/* $Id: cmd.c,v 1.13 2004/05/11 20:44:30 gvg Exp $
  *
  *  CMD.C - command-line interface.
  *
@@ -296,7 +296,7 @@
  */
 
 static VOID
-Execute (LPTSTR first, LPTSTR rest)
+Execute (LPTSTR full, LPTSTR first, LPTSTR rest)
 {
 	TCHAR szFullName[MAX_PATH];
 #ifndef __REACTOS__
@@ -352,17 +352,13 @@
 	else
 	{
 		/* exec the program */
-		TCHAR szFullCmdLine [CMDLINE_LENGTH];
 		PROCESS_INFORMATION prci;
 		STARTUPINFO stui;
 
 #ifdef _DEBUG
-		DebugPrintf (_T("[EXEC: %s %s]\n"), szFullName, rest);
+		DebugPrintf (_T("[EXEC: %s %s]\n"), full, rest);
 #endif
 		/* build command line for CreateProcess() */
-		_tcscpy (szFullCmdLine, first);
-		_tcscat (szFullCmdLine, _T(" "));
-		_tcscat (szFullCmdLine, rest);
 
 		/* fill startup info */
 		memset (&stui, 0, sizeof (STARTUPINFO));
@@ -373,9 +369,9 @@
 		// return console to standard mode
 		SetConsoleMode (GetStdHandle(STD_INPUT_HANDLE),
 		                ENABLE_LINE_INPUT | ENABLE_PROCESSED_INPUT | ENABLE_ECHO_INPUT );
-		
+
 		if (CreateProcess (szFullName,
-		                   szFullCmdLine,
+		                   full,
 		                   NULL,
 		                   NULL,
 		                   FALSE,
@@ -433,7 +429,7 @@
 	TCHAR com[CMDLINE_LENGTH];  /* the first word in the command */
 	LPTSTR cp = com;
 	LPTSTR cstart;
-	LPTSTR rest = line;   /* pointer to the rest of the command line */
+	LPTSTR rest;   /* pointer to the rest of the command line */
 	INT cl;
 	LPCOMMAND cmdptr;
 
@@ -442,8 +438,9 @@
 #endif /* DEBUG */
 
 	/* Skip over initial white space */
-	while (_istspace (*rest))
-		rest++;
+	while (_istspace (*line))
+		line++;
+	rest = line;
 
 	cstart = rest;
 
@@ -458,6 +455,8 @@
 
 			while(*rest != _T('\0') && *rest != _T('"'))
 				*cp++ = _totlower (*rest++);
+			if (*rest == _T('"'))
+				rest++;
 		}
 		else
 		{
@@ -486,7 +485,7 @@
 			/* If end of table execute ext cmd */
 			if (cmdptr->name == NULL)
 			{
-				Execute (com, rest);
+				Execute (line, com, rest);
 				break;
 			}
 
CVSspam 0.2.8