Code

sysdb: Append newlines to lines read from readline().
authorSebastian Harl <sh@tokkee.org>
Mon, 6 Jan 2014 22:32:31 +0000 (23:32 +0100)
committerSebastian Harl <sh@tokkee.org>
Mon, 6 Jan 2014 22:32:31 +0000 (23:32 +0100)
Else, whitespace will be missing in multi-line commands.

src/tools/sysdb/input.c

index 0513ee0586ad6dc6fcc3dbfa0b39cf0a13297fc9..72e360cd5a87fcf61deaca181c8cc5a5ccd0a271 100644 (file)
@@ -75,9 +75,10 @@ input_readline(sdb_strbuf_t *buf)
        if (! line)
                return 0;
 
-       len = strlen(line);
+       len = strlen(line) + 1;
 
        sdb_strbuf_append(buf, line);
+       sdb_strbuf_append(buf, "\n");
        free(line);
        return len;
 } /* input_readline */