aboutsummaryrefslogtreecommitdiff
path: root/t/rt.c
diff options
context:
space:
mode:
Diffstat (limited to 't/rt.c')
-rw-r--r--t/rt.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/t/rt.c b/t/rt.c
index 05eb036..2c404e2 100644
--- a/t/rt.c
+++ b/t/rt.c
@@ -92,14 +92,17 @@ static void
linemon(const char *ptr, size_t len, void *data)
{
struct linemon_closure *clos = data;
-
- if (!clos->cont) {
- printf("%s:", clos->prefix);
- if (!(len == 1 && ptr[0] == '\n'))
- putchar(' ');
- }
- fwrite(ptr, len, 1, stdout);
- clos->cont = ptr[len-1] != '\n';
+
+ if (len) {
+ if (!clos->cont) {
+ printf("%s:", clos->prefix);
+ if (!(len == 1 && ptr[0] == '\n'))
+ putchar(' ');
+ }
+ fwrite(ptr, len, 1, stdout);
+ } else
+ fflush(stdout);
+ clos->cont = !(len == 0 || ptr[len-1] == '\n');
}
static void

Return to:

Send suggestions and report system problems to the System administrator.