Commit ef9df1e7 authored by Brad King's avatar Brad King
Browse files

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.
parent 177183a6
......@@ -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))
{
......
......@@ -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))
{
......
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