BUG/MINOR: config: add a missing "ELIF_TAKE" test for ".elif" condition evaluator

This missing state was causing a second elif condition to be evaluated
after a first one succeeded after a .if failed. For example in the test
below the else would be executed:

     .if    0
     .elif  1
     .elif  0
     .else
     .endif

No backport is needed, this is 2.4-only.
This commit is contained in:
Willy Tarreau 2021-05-06 08:48:09 +02:00
parent 6e647c94f2
commit f67ff02072

View File

@ -1891,6 +1891,7 @@ int readcfgfile(const char *file)
if (nested_conds[nested_cond_lvl] == NESTED_COND_IF_TAKE ||
nested_conds[nested_cond_lvl] == NESTED_COND_IF_SKIP ||
nested_conds[nested_cond_lvl] == NESTED_COND_ELIF_TAKE ||
nested_conds[nested_cond_lvl] == NESTED_COND_ELIF_SKIP) {
nested_conds[nested_cond_lvl] = NESTED_COND_ELIF_SKIP;
} else if (!*args[1] || *args[1] == '0') {