diff options
author | Bert <ber.t@gmx.com> | 2011-02-14 17:51:04 +0100 |
---|---|---|
committer | Bert <ber.t@gmx.com> | 2011-02-14 17:51:04 +0100 |
commit | 26cc5aff69856caf01a925ee1357b3650d806d67 (patch) | |
tree | e0ecd554c2a910f896e082271d8bc50905e51e68 /options.c | |
parent | ea65610747bf324c98f390fba91b8a7c8818006a (diff) | |
download | nsxiv-26cc5aff69856caf01a925ee1357b3650d806d67.tar.zst |
Read filenames from stdin
Diffstat (limited to 'options.c')
-rw-r--r-- | options.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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; } |