From a87e782a2dfb0837e863867a5e3361143eaede9b Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Fri, 16 Jul 2021 19:14:54 +0200 Subject: [PATCH] MINOR: init: make -cc support environment variables expansion I found myself a few times testing some conditoin examples from the doc against command line's "-cc" to see that they didn't work with environment variables expansion. Not being documented as being on purpose it looks like a miss, so let's add PARSE_OPT_ENV and PARSE_OPT_WORD_EXPAND to be able to test for example -cc "streq(${WITH_SSL},yes)" to help debug expressions. --- src/haproxy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/haproxy.c b/src/haproxy.c index 8a9f50cf8..2d32bb84f 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -1808,7 +1808,7 @@ static void init(int argc, char **argv) size_t outlen = strlen(check_condition) + 1; err = parse_line(check_condition, check_condition, &outlen, args, &arg, - PARSE_OPT_DQUOTE | PARSE_OPT_SQUOTE | PARSE_OPT_BKSLASH, + PARSE_OPT_ENV | PARSE_OPT_WORD_EXPAND | PARSE_OPT_DQUOTE | PARSE_OPT_SQUOTE | PARSE_OPT_BKSLASH, &errptr); if (err & PARSE_ERR_QUOTE) {