From: Jiri Denemark Date: Fri, 10 Jun 2016 15:15:25 +0000 (+0200) Subject: qemucapsprobe: Don't put empty line at EOF X-Git-Tag: v2.0.0-rc1~111 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=423015137a40c225e32e694483819ffe52f15089;p=thirdparty%2Flibvirt.git qemucapsprobe: Don't put empty line at EOF Signed-off-by: Jiri Denemark --- diff --git a/tests/qemucapsprobemock.c b/tests/qemucapsprobemock.c index 8ff4de970b..0c4c786b15 100644 --- a/tests/qemucapsprobemock.c +++ b/tests/qemucapsprobemock.c @@ -62,6 +62,7 @@ qemuMonitorJSONIOProcessLine(qemuMonitorPtr mon, const char *line, qemuMonitorMessagePtr msg) { + static bool first = true; virJSONValuePtr value = NULL; char *json = NULL; int ret; @@ -76,6 +77,11 @@ qemuMonitorJSONIOProcessLine(qemuMonitorPtr mon, char *p; bool skip = false; + if (first) + first = false; + else + putchar('\n'); + for (p = json; *p; p++) { if (skip && *p == '\n') { continue; @@ -84,7 +90,6 @@ qemuMonitorJSONIOProcessLine(qemuMonitorPtr mon, putchar(*p); } } - putchar('\n'); } VIR_FREE(json);