From 26cc5aff69856caf01a925ee1357b3650d806d67 Mon Sep 17 00:00:00 2001 From: Bert Date: Mon, 14 Feb 2011 17:51:04 +0100 Subject: Read filenames from stdin --- options.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'options.c') 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 +#include #include #include @@ -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; } -- cgit v1.2.3-54-g00ecf