Commit 1d301630 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

filelist: Do not print error when a correct filelist file is specified

parent c8667c1a
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -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,13 +536,16 @@ 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)) {
	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;

	errno = 0;