mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-07 07:37:02 +02:00
BUG/MINOR: config: .if/.elif should also accept negative integers
The doc about .if/.elif config block conditions says: a non-nul integer (e.g. '1'), always returns "true" So we must accept negative integers as well. The test was made on atoi() > 0. No backport is needed, this is only 2.4.
This commit is contained in:
parent
f67ff02072
commit
71990e6bec
@ -1865,7 +1865,7 @@ int readcfgfile(const char *file)
|
||||
} else if (!*args[1] || *args[1] == '0') {
|
||||
/* empty = false */
|
||||
nested_conds[nested_cond_lvl] = NESTED_COND_IF_DROP;
|
||||
} else if (atoi(args[1]) > 0) {
|
||||
} else if (atoi(args[1]) != 0) {
|
||||
/* true */
|
||||
nested_conds[nested_cond_lvl] = NESTED_COND_IF_TAKE;
|
||||
} else {
|
||||
@ -1897,7 +1897,7 @@ int readcfgfile(const char *file)
|
||||
} else if (!*args[1] || *args[1] == '0') {
|
||||
/* empty = false */
|
||||
nested_conds[nested_cond_lvl] = NESTED_COND_ELIF_DROP;
|
||||
} else if (atoi(args[1]) > 0) {
|
||||
} else if (atoi(args[1]) != 0) {
|
||||
/* true */
|
||||
nested_conds[nested_cond_lvl] = NESTED_COND_ELIF_TAKE;
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user