зеркало из https://github.com/mozilla/gecko-dev.git
Bug 176543: handle the case of invoking a program wit no arguments. The
command line should be an empty string in that case. Initialize newEnvp. The patch is contributed by Michael Kaply <mkaply@us.ibm.com>.
This commit is contained in:
Родитель
67bdf7e14a
Коммит
d73aa81a3e
|
@ -123,9 +123,9 @@ static int assembleCmdLine(char *const *argv, char **cmdLine)
|
||||||
/*
|
/*
|
||||||
* Find out how large the command line buffer should be.
|
* Find out how large the command line buffer should be.
|
||||||
*/
|
*/
|
||||||
cmdLineSize = 0;
|
cmdLineSize = 1; /* final null */
|
||||||
for (arg = argv+1; *arg; arg++) {
|
for (arg = argv+1; *arg; arg++) {
|
||||||
cmdLineSize += strlen(*arg) + 1; /* space in between, or final null */
|
cmdLineSize += strlen(*arg) + 1; /* space in between */
|
||||||
}
|
}
|
||||||
*cmdLine = PR_MALLOC(cmdLineSize);
|
*cmdLine = PR_MALLOC(cmdLineSize);
|
||||||
if (*cmdLine == NULL) {
|
if (*cmdLine == NULL) {
|
||||||
|
@ -238,7 +238,7 @@ PRProcess * _PR_CreateOS2Process(
|
||||||
{
|
{
|
||||||
PRProcess *proc = NULL;
|
PRProcess *proc = NULL;
|
||||||
char *cmdLine = NULL;
|
char *cmdLine = NULL;
|
||||||
char **newEnvp;
|
char **newEnvp = NULL;
|
||||||
char *envBlock = NULL;
|
char *envBlock = NULL;
|
||||||
|
|
||||||
STARTDATA startData = {0};
|
STARTDATA startData = {0};
|
||||||
|
|
Загрузка…
Ссылка в новой задаче