aboutsummaryrefslogtreecommitdiff
path: root/options.c
diff options
context:
space:
mode:
Diffstat (limited to 'options.c')
-rw-r--r--options.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/options.c b/options.c
index 3e519f2..0a1aeda 100644
--- a/options.c
+++ b/options.c
@@ -19,6 +19,7 @@
#define _XOPEN_SOURCE
#include <stdlib.h>
+#include <string.h>
#include <stdio.h>
#include <unistd.h>
@@ -106,4 +107,6 @@ void parse_options(int argc, char **argv) {
_options.filenames = (const char**) argv + optind;
_options.filecnt = argc - optind;
+ _options.from_stdin = _options.filecnt == 1 &&
+ strcmp(_options.filenames[0], "-") == 0;
}