diff --git a/src/filelist.c b/src/filelist.c
index eaef54b880272ce6318ebfb52bf2a3ef9cf71434..9391ba0787024c0f8c1a07d556a8c0cbb313ef1a 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);