summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2016-02-18 20:24:17 +0100
committerDaniel Friesel <derf@finalrewind.org>2016-02-18 20:48:54 +0100
commit1d3016306ba7103239ea87d36e66e0ca77d1784b (patch)
treea8b0b0383db3ad8dc6875a41e867d387f2decf53
parentc8667c1a7874490975665d63e4ccf5efcfba23df (diff)
filelist: Do not print error when a correct filelist file is specified
-rw-r--r--src/filelist.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/filelist.c b/src/filelist.c
index 47b0534..7e9dcbe 100644
--- a/src/filelist.c
+++ b/src/filelist.c
@@ -523,6 +523,7 @@ gib_list *feh_read_filelist(char *filename)
FILE *fp;
gib_list *list = NULL;
char s[1024], s1[1024];
+ Imlib_Load_Error err = IMLIB_LOAD_ERROR_NONE;
Imlib_Image tmp_im;
struct stat st;
signed short tmp_magick_timeout;
@@ -535,12 +536,15 @@ gib_list *feh_read_filelist(char *filename)
*/
tmp_magick_timeout = opt.magick_timeout;
opt.magick_timeout = -1;
- if (!stat(filename, &st) && S_ISREG(st.st_mode) &&
- feh_load_image_char(&tmp_im, filename)) {
- weprintf("Filelist file %s is an image, refusing to use it.\n"
- "Did you mix up -f and -F?", filename);
- opt.filelistfile = NULL;
- return NULL;
+ if (!stat(filename, &st) && S_ISREG(st.st_mode)) {
+ tmp_im = imlib_load_image_with_error_return(filename, &err);
+ if (err == IMLIB_LOAD_ERROR_NONE) {
+ gib_imlib_free_image_and_decache(tmp_im);
+ weprintf("Filelist file %s is an image, refusing to use it.\n"
+ "Did you mix up -f and -F?", filename);
+ opt.filelistfile = NULL;
+ return NULL;
+ }
}
opt.magick_timeout = tmp_magick_timeout;