From a43b5836568dd57ed61415a1f058b29e18478059 Mon Sep 17 00:00:00 2001 From: Richard Russon Date: Fri, 21 Dec 2018 16:54:46 +0000 Subject: [PATCH] mbox: allow non-file mailboxes We disallow directories, but allow files or other devices. This means we can run `neomutt -f /dev/null` again. --- mbox/mbox.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mbox/mbox.c b/mbox/mbox.c index cca4a607e..f003fc44e 100644 --- a/mbox/mbox.c +++ b/mbox/mbox.c @@ -1632,11 +1632,14 @@ static int mbox_msg_padding_size(struct Mailbox *m) */ enum MailboxType mbox_path_probe(const char *path, const struct stat *st) { - if (!path) + if (!path || !st) return MUTT_UNKNOWN; - if (!st || !S_ISREG(st->st_mode)) + if (S_ISDIR(st->st_mode)) + { + mutt_error("%s is not a mailbox", path); return MUTT_UNKNOWN; + } if (st->st_size == 0) return MUTT_MBOX; -- 2.50.1