Skip to content

Commit

Permalink
vav: Don't reject individually quoted arguments with ARGV_COMMA
Browse files Browse the repository at this point in the history
  • Loading branch information
walid-git committed Nov 15, 2023
1 parent f354ca9 commit 9411e5e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/libvarnish/vav.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,12 @@ VAV_ParseTxt(const char *b, const char *e, int *argc, int flag)
b++;
continue;
}
if (sep != NULL && *sep == '"' &&
*b == ',' && (flag & ARGV_COMMA)) {
sep = NULL;
b++;
continue;
}
if (sep != NULL && *sep == '"' && *b == '"' && (b - sep) < 2) {
argv[0] = err_missing_separator;
return (argv);
Expand Down Expand Up @@ -402,6 +408,7 @@ static const struct test_case *tests[] = {
TEST_FAIL(0 , "foo\"bar", invalid_quote),
TEST_FAIL(0 , "foo\"bar", invalid_quote),
TEST_PASS(0 , "\"foo\" \"bar\"", "foo", "bar"),
TEST_PASS( C , "\"foo\",\"bar\"", "foo", "bar"),
TEST_PASS( N, "\"foo\"\"bar\"", "\"foo\"\"bar\""),
TEST_FAIL(0 , "\"foo\"\"bar\"", missing_separator),
NULL
Expand Down

0 comments on commit 9411e5e

Please sign in to comment.