mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-21 13:51:26 +02:00
MINOR: arg: improve the error message on missing closing parenthesis
When the closing brace is missing after an argument (acl, ...), the error may report something like "expected ')' before ''". Let's just drop "before ''" when the final word is empty to make the message a bit clearer.
This commit is contained in:
parent
7541056aa0
commit
3e293a9135
@ -359,7 +359,12 @@ int make_arg_list(const char *in, int len, uint64_t mask, struct arg **argp,
|
|||||||
} else {
|
} else {
|
||||||
/* the caller is responsible for freeing this message */
|
/* the caller is responsible for freeing this message */
|
||||||
char *word = (len > 0) ? my_strndup(in, len) : (char *)in;
|
char *word = (len > 0) ? my_strndup(in, len) : (char *)in;
|
||||||
|
|
||||||
|
if (*word)
|
||||||
memprintf(err_msg, "expected ')' before '%s'", word);
|
memprintf(err_msg, "expected ')' before '%s'", word);
|
||||||
|
else
|
||||||
|
memprintf(err_msg, "expected ')'");
|
||||||
|
|
||||||
if (len > 0)
|
if (len > 0)
|
||||||
free(word);
|
free(word);
|
||||||
/* when we're missing a right paren, the empty part preceding
|
/* when we're missing a right paren, the empty part preceding
|
||||||
|
Loading…
x
Reference in New Issue
Block a user