KWSys: Teach Process to error on empty command

Do not try to execute a child with no command line.  Previously this led
to a silent hang.
This commit is contained in:
Brad King 2010-06-11 11:00:38 -04:00
parent 60478de3e5
commit b9e3c243d4
2 changed files with 16 additions and 0 deletions

View File

@ -720,6 +720,14 @@ void kwsysProcess_Execute(kwsysProcess* cp)
return;
}
/* Make sure we have something to run. */
if(cp->NumberOfCommands < 1)
{
strcpy(cp->ErrorMessage, "No command");
cp->State = kwsysProcess_State_Error;
return;
}
/* Initialize the control structure for a new process. */
if(!kwsysProcessInitialize(cp))
{

View File

@ -987,6 +987,14 @@ void kwsysProcess_Execute(kwsysProcess* cp)
return;
}
/* Make sure we have something to run. */
if(cp->NumberOfCommands < 1)
{
strcpy(cp->ErrorMessage, "No command");
cp->State = kwsysProcess_State_Error;
return;
}
/* Initialize the control structure for a new process. */
if(!kwsysProcessInitialize(cp))
{