Skip to content

Commit

Permalink
VSB_quote(QUOTE_CSTR) should not indent with "\t" unless asked.
Browse files Browse the repository at this point in the history
  • Loading branch information
bsdphk committed Jan 9, 2019
1 parent 64e2ba2 commit 1425d2a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/libvarnish/vsb.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ VSB_quote_pfx(struct vsb *s, const char *pfx, const void *v, int len, int how)
break; break;
case '\n': case '\n':
if (how & VSB_QUOTE_CSTR) { 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)) { } else if (how & (VSB_QUOTE_NONL|VSB_QUOTE_UNSAFE)) {
(void)VSB_printf(s, "\n"); (void)VSB_printf(s, "\n");
nl = 1; nl = 1;
Expand Down
5 changes: 2 additions & 3 deletions lib/libvcc/vcc_compile.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -233,9 +233,8 @@ EmitCoordinates(const struct vcc *tl, struct vsb *vsb)
VTAILQ_FOREACH(sp, &tl->sources, list) { VTAILQ_FOREACH(sp, &tl->sources, list) {
VSB_printf(vsb, " /* "); VSB_printf(vsb, " /* ");
VSB_quote(vsb, sp->name, -1, VSB_QUOTE_CSTR); VSB_quote(vsb, sp->name, -1, VSB_QUOTE_CSTR);
VSB_printf(vsb, "*/\n"); VSB_printf(vsb, " */\n");
VSB_printf(vsb, "\t"); VSB_quote_pfx(vsb, "\t", sp->b, sp->e - sp->b, VSB_QUOTE_CSTR);
VSB_quote(vsb, sp->b, sp->e - sp->b, VSB_QUOTE_CSTR);
VSB_printf(vsb, ",\n"); VSB_printf(vsb, ",\n");
} }
VSB_printf(vsb, "};\n\n"); VSB_printf(vsb, "};\n\n");
Expand Down

0 comments on commit 1425d2a

Please sign in to comment.