mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Fixed handling of `!=' assignment. Don't warn if the shell's output is
null, but warn if there was an error reading it.
This commit is contained in:
parent
4d55cbc522
commit
d25a64252b
1 changed files with 7 additions and 6 deletions
|
|
@ -1428,17 +1428,18 @@ Parse_DoVar (line, ctxt)
|
|||
while(((pid = wait(&status)) != cpid) && (pid >= 0))
|
||||
continue;
|
||||
|
||||
res = (char *)Buf_GetAll (buf, &cc);
|
||||
Buf_Destroy (buf, FALSE);
|
||||
|
||||
if (cc == 0) {
|
||||
if (cc == -1) {
|
||||
/*
|
||||
* Couldn't read the child's output -- tell the user and
|
||||
* set the variable to null
|
||||
* Couldn't read all of the child's output -- tell the user
|
||||
* but still use whatever we read. Null output isn't an
|
||||
* error unless there was an error reading it.
|
||||
*/
|
||||
Parse_Error(PARSE_WARNING, "Couldn't read shell's output");
|
||||
}
|
||||
|
||||
res = (char *)Buf_GetAll (buf, &cc);
|
||||
Buf_Destroy (buf, FALSE);
|
||||
|
||||
if (status) {
|
||||
/*
|
||||
* Child returned an error -- tell the user but still use
|
||||
|
|
|
|||
Loading…
Reference in a new issue