]> diplodocus.org Git - nmh/blobdiff - uip/rmm.c
Alter HasSuffixC()'s char * to be const.
[nmh] / uip / rmm.c
index 897c50280428066f0af5f913e06b9d06e3b51430..8644a02fb363c8045c12f662a91d648becb89684 100644 (file)
--- a/uip/rmm.c
+++ b/uip/rmm.c
@@ -37,13 +37,7 @@ main (int argc, char **argv)
     struct msgs_array msgs = { 0, 0, NULL };
     struct msgs *mp;
 
-#ifdef LOCALE
-    setlocale(LC_ALL, "");
-#endif
-    invo_name = r1bindex (argv[0], '/');
-
-    /* read user profile/context */
-    context_read();
+    if (nmh_init(argv[0], 1)) { return 1; }
 
     arguments = getarguments (invo_name, argc, argv, 1);
     argp = arguments;
@@ -104,7 +98,7 @@ main (int argc, char **argv)
        adios (maildir, "unable to change directory to");
 
     /* read folder and create message structure */
-    if (!(mp = folder_read (folder)))
+    if (!(mp = folder_read (folder, 1)))
        adios (NULL, "unable to read folder %s", folder);
 
     /* check for empty folder */
@@ -118,24 +112,16 @@ main (int argc, char **argv)
     seq_setprev (mp);          /* set the previous-sequence      */
 
     /*
-     * This is hackish.  If we are using a external rmmproc,
-     * then we need to update the current folder in the
-     * context so the external rmmproc will remove files
-     * from the correct directory.  This should be moved to
-     * folder_delmsgs().
+     * As part of the new world locking order, folder_delmsgs() now updates
+     * the sequence and context for us.  But since folder_delmsgs() doesn't
+     * have access to the folder name, change the context now.
      */
-    if (rmmproc) {
-       context_replace (pfolder, folder);
-       context_save ();
-       fflush (stdout);
-    }
+
+    context_replace (pfolder, folder);
 
     /* "remove" the SELECTED messages */
     folder_delmsgs (mp, unlink_msgs, 0);
 
-    seq_save (mp);             /* synchronize message sequences  */
-    context_replace (pfolder, folder); /* update current folder   */
-    context_save ();                   /* save the context file   */
     folder_free (mp);                  /* free folder structure   */
     done (0);
     return 1;