mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-01-10 16:00:08 +00:00
BUG/MINOR: vars: truncate the variable name in error reports about scope.
When a variable starts with the wrong scope, it is named without stripping the extra characters that follow it, which usually are closing parenthesis. Let's make sure we only report what is expected. This may be backported to 2.4.
This commit is contained in:
parent
c77bad2467
commit
1402fef58a
@ -261,8 +261,8 @@ static char *register_name(const char *name, int len, enum vars_scope *scope,
|
||||
*scope = SCOPE_CHECK;
|
||||
}
|
||||
else {
|
||||
memprintf(err, "invalid variable name '%s'. A variable name must be start by its scope. "
|
||||
"The scope can be 'proc', 'sess', 'txn', 'req', 'res' or 'check'", name);
|
||||
memprintf(err, "invalid variable name '%.*s'. A variable name must be start by its scope. "
|
||||
"The scope can be 'proc', 'sess', 'txn', 'req', 'res' or 'check'", len, name);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user