From: Richard Russon Date: Fri, 21 Dec 2018 16:54:46 +0000 (+0000) Subject: mbox: allow non-file mailboxes X-Git-Tag: 2019-10-25~421 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a43b5836568dd57ed61415a1f058b29e18478059;p=neomutt mbox: allow non-file mailboxes We disallow directories, but allow files or other devices. This means we can run `neomutt -f /dev/null` again. --- 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;