diff --git a/examples/control_structs/if-test-1.cir b/examples/control_structs/if-test-1.cir index 31030682e..41927bdf5 100644 --- a/examples/control_structs/if-test-1.cir +++ b/examples/control_structs/if-test-1.cir @@ -36,7 +36,6 @@ end echo echo "expect Error: testvar_d: no such variable." -echo "expect Warning: NULL arithmetic expression" * in cp_istrue(): wl!=NULL then wl==NULL names==NULL v==NULL if $testvar_d echo "FAIL: you should not see this" diff --git a/src/frontend/cpitf.c b/src/frontend/cpitf.c index 669bdedbd..596ea97c7 100644 --- a/src/frontend/cpitf.c +++ b/src/frontend/cpitf.c @@ -306,6 +306,9 @@ cp_istrue(wordlist *wl) /* First do all the csh-type stuff here... */ wl = wl_copy(wl); wl = cp_variablesubst(wl); + /* return FALSE if this did not expand to anything */ + if (!wl) + return FALSE; wl = cp_bquote(wl); cp_striplist(wl);