From 8458040172357f71bd8682cb200917d3c7624b1b Mon Sep 17 00:00:00 2001 From: Francois Gouget Date: Mon, 19 May 2003 23:16:12 +0000 Subject: [PATCH] Fix CreateProcess("c:\Program Files\hello.bat"). --- scheduler/process.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scheduler/process.c b/scheduler/process.c index 204e1a24d6d..4f54ed211df 100644 --- a/scheduler/process.c +++ b/scheduler/process.c @@ -1264,12 +1264,11 @@ BOOL WINAPI CreateProcessA( LPCSTR app_name, LPSTR cmd_line, LPSECURITY_ATTRIBUT char comspec[MAX_PATH]; if (GetEnvironmentVariableA("COMSPEC", comspec, sizeof(comspec))) { - char *newcmdline, *q = strchr(cmd_line, ' '); - if (!q) q = ""; + char *newcmdline; if ((newcmdline = HeapAlloc( GetProcessHeap(), 0, - strlen(comspec) + strlen(name) + strlen(q) + 8))) + strlen(comspec) + 4 + strlen(tidy_cmdline) + 1))) { - sprintf( newcmdline, "%s /c %s%s", comspec, name, q ); + sprintf( newcmdline, "%s /c %s", comspec, tidy_cmdline); TRACE( "starting %s as batch binary: %s\n", debugstr_a(name), debugstr_a(newcmdline) ); retv = CreateProcessA( comspec, newcmdline, process_attr, thread_attr,