summaryrefslogtreecommitdiffstats
path: root/test-getline.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2015-11-07 20:52:52 +0000
committerIngo Schwarze <schwarze@openbsd.org>2015-11-07 20:52:52 +0000
commitc87f2b1ba757fbed3fb5c8015cc690c723f61b93 (patch)
treed9010efc784d0b9c26c72347c6ab7a8d1429fd81 /test-getline.c
parentf024d444d299de331f8a9c932e479fedfbba6c5e (diff)
downloadmandoc-c87f2b1ba757fbed3fb5c8015cc690c723f61b93.tar.gz
provide a simple stand-alone implementation of getline(3)
for systems lacking it
Diffstat (limited to 'test-getline.c')
-rw-r--r--test-getline.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/test-getline.c b/test-getline.c
new file mode 100644
index 00000000..d05df217
--- /dev/null
+++ b/test-getline.c
@@ -0,0 +1,13 @@
+#include <sys/types.h>
+#include <stdio.h>
+#include <unistd.h>
+
+int
+main(void)
+{
+ char *line = NULL;
+ size_t linesz = 0;
+
+ fclose(stdin);
+ return getline(&line, &linesz, stdin) != -1;
+}