-#define _POSIX_C_SOURCE 199309L
+#define _POSIX_C_SOURCE 200809L
#include <stdio.h>
#include <stdlib.h>
int newline = getchar();
if (newline != EOF && newline != (int)'\n')
die("Expected newline");
+ if (scanf_ret == 0 && newline == (int)'\n')
+ return strdup("\n");
return 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; }