diff options
-rw-r--r-- | Source/kwsys/ProcessUNIX.c | 8 | ||||
-rw-r--r-- | Source/kwsys/ProcessWin32.c | 8 |
2 files changed, 16 insertions, 0 deletions
diff --git a/Source/kwsys/ProcessUNIX.c b/Source/kwsys/ProcessUNIX.c index adadef1..9c66a44 100644 --- a/Source/kwsys/ProcessUNIX.c +++ b/Source/kwsys/ProcessUNIX.c @@ -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)) { diff --git a/Source/kwsys/ProcessWin32.c b/Source/kwsys/ProcessWin32.c index c5ea6db..5aa4d8b 100644 --- a/Source/kwsys/ProcessWin32.c +++ b/Source/kwsys/ProcessWin32.c @@ -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)) { |