diff --git a/parser/parser_yacc.y b/parser/parser_yacc.y index 5612359be..b721aaa67 100644 --- a/parser/parser_yacc.y +++ b/parser/parser_yacc.y @@ -1006,7 +1006,7 @@ factor: TOK_DEFINED TOK_SET_VAR factor: TOK_DEFINED TOK_BOOL_VAR { - cond_expr *conds = new cond_expr($2, BOOLEAN_OP); + cond_expr *conds = new cond_expr($2, DEFINED_OP); PDEBUG("Matched: defined set expr %s value %d\n", $2, conds->eval()); $$ = conds; free($2); diff --git a/parser/tst/simple_tests/conditional/ok_31.sd b/parser/tst/simple_tests/conditional/ok_31.sd new file mode 100644 index 000000000..678989e73 --- /dev/null +++ b/parser/tst/simple_tests/conditional/ok_31.sd @@ -0,0 +1,8 @@ +#=DESCRIPTION conditional within profile +#=EXRESULT PASS + +/bin/true { + if defined $UNKNOWN { + /bin/true rix, + } +}