]> diplodocus.org Git - nmh/blobdiff - uip/mhn.c
prevent spurious errors when requesting specific message parts
[nmh] / uip / mhn.c
index 8a4ab3187367e348cee517984bb229461f0d0292..39d8693372792c748ec5b1bf1ebc12ad0839f458 100644 (file)
--- a/uip/mhn.c
+++ b/uip/mhn.c
@@ -119,12 +119,6 @@ int part_ok (CT, int);
 int type_ok (CT, int);
 void flush_errors (void);
 
-/* mhstoresbr.c */
-typedef struct mhstoreinfo *mhstoreinfo_t;
-mhstoreinfo_t mhstoreinfo_create(CT *, char *, const char *, int, int);
-void mhstoreinfo_free(mhstoreinfo_t);
-void store_all_messages (mhstoreinfo_t);
-
 /* mhcachesbr.c */
 void cache_all_messages (CT *);
 
@@ -446,7 +440,7 @@ do_cache:
      * check if message is coming from file
      */
     if (file) {
-       if (!(cts = (CT *) calloc ((size_t) 2, sizeof(*cts))))
+       if (!(cts = (CT *) mh_xcalloc ((size_t) 2, sizeof(*cts))))
            adios (NULL, "out of memory");
        ctp = cts;
 
@@ -479,7 +473,7 @@ do_cache:
                done (1);
        seq_setprev (mp);       /* set the previous-sequence */
 
-       if (!(cts = (CT *) calloc ((size_t) (mp->numsel + 1), sizeof(*cts))))
+       if (!(cts = (CT *) mh_xcalloc ((size_t) (mp->numsel + 1), sizeof(*cts))))
            adios (NULL, "out of memory");
        ctp = cts;
 
@@ -542,6 +536,14 @@ do_cache:
        mhstoreinfo_free (info);
     }
 
+    /* If reading from a folder, do some updating */
+    if (mp) {
+       context_replace (pfolder, folder);/* update current folder  */
+       seq_setcur (mp, mp->hghsel);      /* update current message */
+       seq_save (mp);                    /* synchronize sequences  */
+       context_save ();                  /* save the context file  */
+    }
+
     /*
      * Cache the message content
      */
@@ -552,7 +554,7 @@ do_cache:
      * Show the message content
      */
     if (showsw)
-       show_all_messages (cts, 0, 0, 0);
+       show_all_messages (cts, 0, 0, 0, NULL);
 
     /* Now free all the structures for the content */
     for (ctp = cts; *ctp; ctp++)
@@ -561,14 +563,6 @@ do_cache:
     free (cts);
     cts = NULL;
 
-    /* If reading from a folder, do some updating */
-    if (mp) {
-       context_replace (pfolder, folder);/* update current folder  */
-       seq_setcur (mp, mp->hghsel);      /* update current message */
-       seq_save (mp);                    /* synchronize sequences  */
-       context_save ();                  /* save the context file  */
-    }
-
     done (0);
     return 1;
 }