diff options
author | Daniel Friesel <derf@finalrewind.org> | 2016-02-18 19:57:28 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2016-02-18 19:57:28 +0100 |
commit | 14073bb4b0cb0cc37d0b8ddfb6c39156c4a03d5b (patch) | |
tree | 970cfe9d30c2c54d0dad5133950adc323c1e2aa8 /src | |
parent | fef6d137ba83bcd0dd79f824a023a0655108ab46 (diff) |
filelist: Don't try to fopen() stdin (it's a stream, not a file)
Diffstat (limited to 'src')
-rw-r--r-- | src/filelist.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/filelist.c b/src/filelist.c index eaef54b..9391ba0 100644 --- a/src/filelist.c +++ b/src/filelist.c @@ -545,7 +545,13 @@ gib_list *feh_read_filelist(char *filename) opt.magick_timeout = tmp_magick_timeout; errno = 0; - if ((fp = fopen(filename, "r")) == NULL) { + + if (!strcmp(filename, "/dev/stdin")) + fp = stdin; + else + fp = fopen(filename, "r"); + + if (fp == NULL) { /* return quietly, as it's okay to specify a filelist file that doesn't exist. In that case we create it on exit. */ return(NULL); |