Commit 8385a88f authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Fix the error emitted if quotes on a line are not properly balanced.



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@5072 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent b6dec792
...@@ -227,7 +227,7 @@ parse_string(char *buf, const struct cmds *cmd, void *priv, struct vtclog *vl) ...@@ -227,7 +227,7 @@ parse_string(char *buf, const struct cmds *cmd, void *priv, struct vtclog *vl)
{ {
char *token_s[MAX_TOKENS], *token_e[MAX_TOKENS]; char *token_s[MAX_TOKENS], *token_e[MAX_TOKENS];
struct vsb *token_exp[MAX_TOKENS]; struct vsb *token_exp[MAX_TOKENS];
char *p, *q; char *p, *q, *f;
int nest_brace; int nest_brace;
int tn; int tn;
const struct cmds *cp; const struct cmds *cp;
...@@ -249,6 +249,7 @@ parse_string(char *buf, const struct cmds *cmd, void *priv, struct vtclog *vl) ...@@ -249,6 +249,7 @@ parse_string(char *buf, const struct cmds *cmd, void *priv, struct vtclog *vl)
/* First content on line, collect tokens */ /* First content on line, collect tokens */
tn = 0; tn = 0;
f = p;
while (*p != '\0') { while (*p != '\0') {
assert(tn < MAX_TOKENS); assert(tn < MAX_TOKENS);
if (*p == '\n') { /* End on NL */ if (*p == '\n') { /* End on NL */
...@@ -273,8 +274,9 @@ parse_string(char *buf, const struct cmds *cmd, void *priv, struct vtclog *vl) ...@@ -273,8 +274,9 @@ parse_string(char *buf, const struct cmds *cmd, void *priv, struct vtclog *vl)
q++; q++;
} else { } else {
if (*p == '\n') if (*p == '\n')
fprintf(stderr, vtc_log(vl, 0,
"Unterminated quoted string in line:\n%s", p); "Unterminated quoted string in line: %*.*s",
(int)(p - f), (int)(p - f), f);
assert(*p != '\n'); assert(*p != '\n');
*q++ = *p; *q++ = *p;
} }
......
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