qemucapsprobe: Don't put empty line at EOF

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
Jiri Denemark 2016-06-10 17:15:25 +02:00
parent 70a576899a
commit 423015137a

View File

@ -62,6 +62,7 @@ qemuMonitorJSONIOProcessLine(qemuMonitorPtr mon,
const char *line, const char *line,
qemuMonitorMessagePtr msg) qemuMonitorMessagePtr msg)
{ {
static bool first = true;
virJSONValuePtr value = NULL; virJSONValuePtr value = NULL;
char *json = NULL; char *json = NULL;
int ret; int ret;
@ -76,6 +77,11 @@ qemuMonitorJSONIOProcessLine(qemuMonitorPtr mon,
char *p; char *p;
bool skip = false; bool skip = false;
if (first)
first = false;
else
putchar('\n');
for (p = json; *p; p++) { for (p = json; *p; p++) {
if (skip && *p == '\n') { if (skip && *p == '\n') {
continue; continue;
@ -84,7 +90,6 @@ qemuMonitorJSONIOProcessLine(qemuMonitorPtr mon,
putchar(*p); putchar(*p);
} }
} }
putchar('\n');
} }
VIR_FREE(json); VIR_FREE(json);