Bugfix: Allow lpCommandLine == NULL in CreateProcess().

This commit is contained in:
Ulrich Weigand 1999-03-10 13:28:54 +00:00 committed by Alexandre Julliard
parent 175989dbd4
commit aa23b0bd63
1 changed files with 9 additions and 8 deletions

View File

@ -837,14 +837,15 @@ BOOL WINAPI CreateProcessA( LPCSTR lpApplicationName, LPSTR lpCommandLine,
*p = '\0';
#endif
}
if (strlen(name)) {
get_executable_name(lpCommandLine, cmdline, sizeof(cmdline), &p, TRUE);
strcat(cmdline, p);
} else {
get_executable_name(lpCommandLine, name, sizeof(name), &p, TRUE);
strcpy(cmdline, name);
strcat(cmdline, p);
}
if (lpCommandLine)
if (strlen(name)) {
get_executable_name(lpCommandLine, cmdline, sizeof(cmdline), &p, TRUE);
strcat(cmdline, p);
} else {
get_executable_name(lpCommandLine, name, sizeof(name), &p, TRUE);
strcpy(cmdline, name);
strcat(cmdline, p);
}
if (!strchr(name, '\\') && !strchr(name, '.'))
strcat(name, ".exe");