From 66d8935bb921a6ca5b4f2c5e0bdf5dcdf8d9c28d Mon Sep 17 00:00:00 2001 From: Thomas Roessler Date: Sun, 8 Feb 2004 09:38:38 +0000 Subject: [PATCH] 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. --- muttlib.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/muttlib.c b/muttlib.c index 8370a3e8..5f155147 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"); -- 2.40.0