Commit 6bdfb437 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Don't quote NL in panic messages

parent 211fe2ce
......@@ -117,7 +117,8 @@ mgt_panic_record(pid_t r)
VTIM_format(VTIM_real(), time_str);
VSB_printf(child_panic, "Panic at: %s\n", time_str);
VSB_quote(child_panic, heritage.panic_str,
strnlen(heritage.panic_str, heritage.panic_str_len), 0);
strnlen(heritage.panic_str, heritage.panic_str_len),
VSB_QUOTE_NONL);
AZ(VSB_finish(child_panic));
MGT_complain(C_ERR, "Child (%jd) %s",
(intmax_t)r, VSB_data(child_panic));
......
......@@ -75,6 +75,7 @@ int VSB_finish(struct vsb *);
char *VSB_data(const struct vsb *);
ssize_t VSB_len(const struct vsb *);
void VSB_delete(struct vsb *);
#define VSB_QUOTE_NONL 1
void VSB_quote(struct vsb *s, const char *p, int len, int how);
void VSB_indent(struct vsb *, int);
#ifdef __cplusplus
......
......@@ -519,7 +519,10 @@ VSB_quote(struct vsb *s, const char *p, int len, int how)
(void)VSB_putc(s, *q);
break;
case '\n':
(void)VSB_cat(s, "\\n");
if (how & VSB_QUOTE_NONL)
(void)VSB_cat(s, "\n");
else
(void)VSB_cat(s, "\\n");
break;
case '\r':
(void)VSB_cat(s, "\\r");
......
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