diff --git a/display_json.c b/display_json.c index 29c1bf4..c47dbbb 100644 --- a/display_json.c +++ b/display_json.c @@ -1008,6 +1008,11 @@ json_escape(char *string) *b++ = '"'; continue; + case '\n': + *b++ = '\\'; + *b++ = 'n'; + continue; + case '\\': *b++ = '\\'; *b++ = '\\'; diff --git a/qstat.c b/qstat.c index e6a3538..865abe7 100644 --- a/qstat.c +++ b/qstat.c @@ -6453,7 +6453,7 @@ deal_with_q2_packet(struct qserver *server, char *rawpkt, int pktlen) pkt += strlen(key) + 1; // Find the value - end = strpbrk(pkt, "\\\n"); + end = strpbrk(pkt, strcmp(key, "fs_manifest") ? "\\\n" : "\\"); if (NULL == end) { // Last value end = rawpkt + pktlen;