mirror of
http://git.haproxy.org/git/haproxy.git
synced 2026-02-06 18:23:29 +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:
@@ -359,7 +359,12 @@ int make_arg_list(const char *in, int len, uint64_t mask, struct arg **argp,
|
||||
} else {
|
||||
/* the caller is responsible for freeing this message */
|
||||
char *word = (len > 0) ? my_strndup(in, len) : (char *)in;
|
||||
memprintf(err_msg, "expected ')' before '%s'", word);
|
||||
|
||||
if (*word)
|
||||
memprintf(err_msg, "expected ')' before '%s'", word);
|
||||
else
|
||||
memprintf(err_msg, "expected ')'");
|
||||
|
||||
if (len > 0)
|
||||
free(word);
|
||||
/* when we're missing a right paren, the empty part preceding
|
||||
|
||||
Reference in New Issue
Block a user