From: Scott Worley Date: Fri, 15 Sep 2023 01:00:09 +0000 (-0700) Subject: Prompt output: Line-buffered X-Git-Tag: v1.0.0~4 X-Git-Url: http://git.scottworley.com/uniqt/commitdiff_plain/be6fd520dc5a19a0d08a308cb2152f2d2a14f71f?ds=inline Prompt output: Line-buffered --- diff --git a/uniqt.c b/uniqt.c index b755f4e..a42a001 100644 --- a/uniqt.c +++ b/uniqt.c @@ -54,6 +54,8 @@ static void write_line(time_range_t *range, char *line) { return; if (printf("%ld %ld %s\n", range->start, range->end, line) < 0) die("Couldn't write"); + if (fflush(stdout) == EOF) + die_err("Couldn't flush"); } static int same(char *a, char *b) { return a && b && strcmp(a, b) == 0; }