From: Thomas Roessler Date: Sun, 8 Feb 2004 09:38:38 +0000 (+0000) Subject: Change the logic in mutt_open_read to only catch directories -- mutt X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=748c3a3e210eb71685fd825be5b755a360a14d19;p=neomutt Change the logic in mutt_open_read to only catch directories -- mutt may legitimately read devices (think /dev/null) or named pipes. Also delegate error reporting to the calling function by setting errno. --- diff --git a/muttlib.c b/muttlib.c index 8370a3e86..5f155147c 100644 --- a/muttlib.c +++ b/muttlib.c @@ -1152,13 +1152,10 @@ FILE *mutt_open_read (const char *path, pid_t *thepid) else { if (stat (path, &s) < 0) - { - mutt_error (_("%s: stat: %s"), path, strerror (errno)); return (NULL); - } - if (!S_ISREG (s.st_mode)) + if (S_ISDIR (s.st_mode)) { - mutt_error (_("%s: not a regular file"), path); + errno = EINVAL; return (NULL); } f = fopen (path, "r");