r5072 - trunk/varnish-cache/bin/varnishtest

phk at varnish-cache.org phk at varnish-cache.org
Mon Aug 9 08:10:18 CEST 2010


Author: phk
Date: 2010-08-09 08:10:17 +0200 (Mon, 09 Aug 2010)
New Revision: 5072

Modified:
   trunk/varnish-cache/bin/varnishtest/vtc.c
Log:
Fix the error emitted if quotes on a line are not properly balanced.



Modified: trunk/varnish-cache/bin/varnishtest/vtc.c
===================================================================
--- trunk/varnish-cache/bin/varnishtest/vtc.c	2010-08-04 13:13:13 UTC (rev 5071)
+++ trunk/varnish-cache/bin/varnishtest/vtc.c	2010-08-09 06:10:17 UTC (rev 5072)
@@ -227,7 +227,7 @@
 {
 	char *token_s[MAX_TOKENS], *token_e[MAX_TOKENS];
 	struct vsb *token_exp[MAX_TOKENS];
-	char *p, *q;
+	char *p, *q, *f;
 	int nest_brace;
 	int tn;
 	const struct cmds *cp;
@@ -249,6 +249,7 @@
 
 		/* First content on line, collect tokens */
 		tn = 0;
+		f = p;
 		while (*p != '\0') {
 			assert(tn < MAX_TOKENS);
 			if (*p == '\n') { /* End on NL */
@@ -273,8 +274,9 @@
 						q++;
 					} else {
 						if (*p == '\n')
-							fprintf(stderr,
-				"Unterminated quoted string in line:\n%s", p);
+							vtc_log(vl, 0,
+				"Unterminated quoted string in line: %*.*s",
+				(int)(p - f), (int)(p - f), f);
 						assert(*p != '\n');
 						*q++ = *p;
 					}




More information about the varnish-commit mailing list