Commit 84580401 authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

Fix CreateProcess("c:\Program Files\hello.bat").

parent b367a6e6
...@@ -1264,12 +1264,11 @@ BOOL WINAPI CreateProcessA( LPCSTR app_name, LPSTR cmd_line, LPSECURITY_ATTRIBUT ...@@ -1264,12 +1264,11 @@ BOOL WINAPI CreateProcessA( LPCSTR app_name, LPSTR cmd_line, LPSECURITY_ATTRIBUT
char comspec[MAX_PATH]; char comspec[MAX_PATH];
if (GetEnvironmentVariableA("COMSPEC", comspec, sizeof(comspec))) if (GetEnvironmentVariableA("COMSPEC", comspec, sizeof(comspec)))
{ {
char *newcmdline, *q = strchr(cmd_line, ' '); char *newcmdline;
if (!q) q = "";
if ((newcmdline = HeapAlloc( GetProcessHeap(), 0, 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", TRACE( "starting %s as batch binary: %s\n",
debugstr_a(name), debugstr_a(newcmdline) ); debugstr_a(name), debugstr_a(newcmdline) );
retv = CreateProcessA( comspec, newcmdline, process_attr, thread_attr, retv = CreateProcessA( comspec, newcmdline, process_attr, thread_attr,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment