]> granicus.if.org Git - neomutt/commitdiff
fix some mailbox logic
authorRichard Russon <rich@flatcap.org>
Mon, 15 Oct 2018 15:21:51 +0000 (16:21 +0100)
committerRichard Russon <rich@flatcap.org>
Mon, 15 Oct 2018 17:42:53 +0000 (18:42 +0100)
mailbox.c
pop/pop.c

index 7b7aa702cbb66f78abfb8ce42d15293f9d7e82ed..49da6307245ce14a0e8104bbe7795f8312cce38b 100644 (file)
--- a/mailbox.c
+++ b/mailbox.c
@@ -332,16 +332,23 @@ static void mailbox_check(struct Mailbox *m, struct stat *ctx_sb, bool check_sta
     m->has_new = false;
 #ifdef USE_POP
     if (pop_path_probe(m->path, NULL) == MUTT_POP)
+    {
       m->magic = MUTT_POP;
+    }
     else
 #endif
 #ifdef USE_NNTP
         if ((m->magic == MUTT_NNTP) || (nntp_path_probe(m->path, NULL) == MUTT_NNTP))
+    {
       m->magic = MUTT_NNTP;
+    }
+    else
 #endif
 #ifdef USE_NOTMUCH
     if (nm_path_probe(m->path, NULL) == MUTT_NOTMUCH)
+    {
       m->magic = MUTT_NOTMUCH;
+    }
     else
 #endif
         if (stat(m->path, &sb) != 0 || (S_ISREG(sb.st_mode) && sb.st_size == 0) ||
index 87f0c468ea47ae796f0783652f6f43caeb2eddcd..063b5f0e20ffd33084cf73729ab00afd8653fed6 100644 (file)
--- a/pop/pop.c
+++ b/pop/pop.c
@@ -468,6 +468,7 @@ static int pop_fetch_headers(struct Context *ctx)
 
         /* Reattach the private data */
         ctx->mailbox->hdrs[i]->data = edata;
+        ctx->mailbox->hdrs[i]->free_data = free_emaildata;
         ret = 0;
         hcached = true;
       }
@@ -1078,6 +1079,7 @@ static int pop_msg_open(struct Context *ctx, struct Message *msg, int msgno)
 
   /* Reattach the private data */
   e->data = edata;
+  e->free_data = free_emaildata;
 
   e->lines = 0;
   fgets(buf, sizeof(buf), msg->fp);
@@ -1118,10 +1120,10 @@ int pop_path_probe(const char *path, const struct stat *st)
     return MUTT_UNKNOWN;
 
   if (mutt_str_strncasecmp(path, "pop://", 6) == 0)
-    return MUTT_NOTMUCH;
+    return MUTT_POP;
 
   if (mutt_str_strncasecmp(path, "pops://", 7) == 0)
-    return MUTT_NOTMUCH;
+    return MUTT_POP;
 
   return MUTT_UNKNOWN;
 }