aboutsummaryrefslogtreecommitdiffstatshomepage
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
commit91090b741273a8ad6061114d369045a4b16a580c (patch)
tree094288d07d953ce24e6d9eeccc5d4350f43a6c6e /test-getline.c
parent52461cacec49af96b6b0643f4322e9fc0b36d403 (diff)
downloadmandoc-91090b741273a8ad6061114d369045a4b16a580c.tar.gz
mandoc-91090b741273a8ad6061114d369045a4b16a580c.tar.zst
mandoc-91090b741273a8ad6061114d369045a4b16a580c.zip
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;
+}