From: Remi Tricot-Le Breton Date: Mon, 2 Oct 2023 15:46:54 +0000 (+0200) Subject: Revert "MEDIUM: sample: Small fix in function check_operator for eror reporting" X-Git-Tag: v2.9-dev7~52 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6fe57303f701dcd67f6efc7f5a894b3180f54b93;p=thirdparty%2Fhaproxy.git Revert "MEDIUM: sample: Small fix in function check_operator for eror reporting" This reverts commit d897d7da87b8894866572c56e9c495a2b290620a. The "check_operator" function is used for all the operator converters such as "and", "or", "add"... With such a converter that accepts a variable name as well as an integer, the "vars_check_arg" call is expected to fail when an integer is provided. Passing an "err" variable has the unwanted side effect of raising a warning during init for a configuration such as the following: http-request set-query "s=%[rand,add(20)]" which raises the following warning: [WARNING] (33040) : config : parsing [hap.cfg:14] : invalid variable name '20'. A variable name must be start by its scope. The scope can be 'proc', 'sess', 'txn', 'req', 'res' or 'check'. --- diff --git a/src/sample.c b/src/sample.c index 6e860f31ee..bb7db28e79 100644 --- a/src/sample.c +++ b/src/sample.c @@ -3156,7 +3156,7 @@ static int check_operator(struct arg *args, struct sample_conv *conv, long long int i; /* Try to decode a variable. */ - if (vars_check_arg(&args[0], err)) + if (vars_check_arg(&args[0], NULL)) return 1; /* Try to convert an integer */