[master] 1425d2ae3 VSB_quote(QUOTE_CSTR) should not indent with "\t" unless asked.

Poul-Henning Kamp phk at FreeBSD.org
Wed Jan 9 10:47:07 UTC 2019


commit 1425d2ae3cfff0a7ca8dd4b3696118ebf474b0d3
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Wed Jan 9 09:37:39 2019 +0000

    VSB_quote(QUOTE_CSTR) should not indent with "\t" unless asked.

diff --git a/lib/libvarnish/vsb.c b/lib/libvarnish/vsb.c
index 0e92b1771..5101a9007 100644
--- a/lib/libvarnish/vsb.c
+++ b/lib/libvarnish/vsb.c
@@ -573,7 +573,7 @@ VSB_quote_pfx(struct vsb *s, const char *pfx, const void *v, int len, int how)
 			break;
 		case '\n':
 			if (how & VSB_QUOTE_CSTR) {
-				(void)VSB_printf(s, "\\n\"\n%s\t\"", pfx);
+				(void)VSB_printf(s, "\\n\"\n%s\"", pfx);
 			} else if (how & (VSB_QUOTE_NONL|VSB_QUOTE_UNSAFE)) {
 				(void)VSB_printf(s, "\n");
 				nl = 1;
diff --git a/lib/libvcc/vcc_compile.c b/lib/libvcc/vcc_compile.c
index 6182eadea..d9bc4f84b 100644
--- a/lib/libvcc/vcc_compile.c
+++ b/lib/libvcc/vcc_compile.c
@@ -233,9 +233,8 @@ EmitCoordinates(const struct vcc *tl, struct vsb *vsb)
 	VTAILQ_FOREACH(sp, &tl->sources, list) {
 		VSB_printf(vsb, "    /* ");
 		VSB_quote(vsb, sp->name, -1, VSB_QUOTE_CSTR);
-		VSB_printf(vsb, "*/\n");
-		VSB_printf(vsb, "\t");
-		VSB_quote(vsb, sp->b, sp->e - sp->b, VSB_QUOTE_CSTR);
+		VSB_printf(vsb, " */\n");
+		VSB_quote_pfx(vsb, "\t", sp->b, sp->e - sp->b, VSB_QUOTE_CSTR);
 		VSB_printf(vsb, ",\n");
 	}
 	VSB_printf(vsb, "};\n\n");


More information about the varnish-commit mailing list