Commit 57c23063 authored by Walid Boudebouda's avatar Walid Boudebouda

vav: Don't reject individually quoted arguments

Cli command '"help" "help"' was wrongly rejected with error
message: "Missing separator between arguments"
parent 35546e56
......@@ -49,3 +49,5 @@ varnish v1 -cliexpect 60 "param.show first_byte_timeout"
varnish v1 -cliok "param.set cli_limit 128"
varnish v1 -clierr 201 "param.show"
varnish v1 -cliok "\"help\" \"help\""
......@@ -192,7 +192,7 @@ VAV_ParseTxt(const char *b, const char *e, int *argc, int flag)
b++;
continue;
}
if (sep != NULL && *sep == '"' && *b == '"') {
if (sep != NULL && *sep == '"' && *b == '"' && (b - sep) < 2) {
argv[0] = err_missing_separator;
return (argv);
}
......@@ -401,6 +401,7 @@ static const struct test_case *tests[] = {
TEST_PASS( N, "foo\"bar", "foo\"bar"),
TEST_FAIL(0 , "foo\"bar", invalid_quote),
TEST_FAIL(0 , "foo\"bar", invalid_quote),
TEST_PASS(0 , "\"foo\" \"bar\"", "foo", "bar"),
TEST_PASS( N, "\"foo\"\"bar\"", "\"foo\"\"bar\""),
TEST_FAIL(0 , "\"foo\"\"bar\"", missing_separator),
NULL
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment