diff options
Diffstat (limited to 't/rt.c')
-rw-r--r-- | t/rt.c | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -91,9 +91,12 @@ static void | |||
91 | linemon(const char *ptr, size_t len, void *data) | 91 | linemon(const char *ptr, size_t len, void *data) |
92 | { | 92 | { |
93 | struct linemon_closure *clos = data; | 93 | struct linemon_closure *clos = data; |
94 | 94 | ||
95 | if (!clos->cont) | 95 | if (!clos->cont) { |
96 | fprintf(stdout, "[%s]: ", clos->prefix); | 96 | printf("%s:", clos->prefix); |
97 | if (!(len == 1 && ptr[0] == '\n')) | ||
98 | putchar(' '); | ||
99 | } | ||
97 | fwrite(ptr, len, 1, stdout); | 100 | fwrite(ptr, len, 1, stdout); |
98 | clos->cont = ptr[len-1] != '\n'; | 101 | clos->cont = ptr[len-1] != '\n'; |
99 | } | 102 | } |
@@ -116,7 +119,10 @@ nl(struct runcap *rc, int stream) | |||
116 | n = 1; | 119 | n = 1; |
117 | while ((res = runcap_getline(rc, stream, &buf, &size)) > 0) { | 120 | while ((res = runcap_getline(rc, stream, &buf, &size)) > 0) { |
118 | buf[res-1] = 0; | 121 | buf[res-1] = 0; |
119 | printf("%*zu: %s\n", width, n, buf); | 122 | printf("%*zu:", width, n); |
123 | if (buf[0]) | ||
124 | printf(" %s", buf); | ||
125 | putchar('\n'); | ||
120 | n++; | 126 | n++; |
121 | } | 127 | } |
122 | if (res) | 128 | if (res) |