]> granicus.if.org Git - neomutt/commitdiff
mbox: recognise empty file
authorRichard Russon <rich@flatcap.org>
Fri, 26 Oct 2018 15:35:40 +0000 (16:35 +0100)
committerRichard Russon <rich@flatcap.org>
Fri, 26 Oct 2018 15:35:40 +0000 (16:35 +0100)
mbox/mbox.c

index dc5480a723bb967bba064c9bee8ad3d1e3bf2901..903d518c6f9912db27b94c09994ce2519f4e2822 100644 (file)
@@ -1602,6 +1602,9 @@ int mbox_path_probe(const char *path, const struct stat *st)
   if (!st || !S_ISREG(st->st_mode))
     return MUTT_UNKNOWN;
 
+  if (st->st_size == 0)
+    return MUTT_MBOX;
+
   FILE *fp = fopen(path, "r");
   if (!fp)
     return MUTT_UNKNOWN;