s/pfolder/curfolder/g
[mmh] / uip / sortm.c
index a5d0e11..0caab30 100644 (file)
@@ -78,7 +78,7 @@ main(int argc, char **argv)
 #ifdef LOCALE
        setlocale(LC_ALL, "");
 #endif
-       invo_name = r1bindex(argv[0], '/');
+       invo_name = mhbasename(argv[0]);
 
        /* read user profile/context */
        context_read();
@@ -159,20 +159,18 @@ main(int argc, char **argv)
                        if (folder)
                                adios(NULL, "only one folder at a time!");
                        else
-                               folder = pluspath(cp);
+                               folder = getcpy(expandfol(cp));
                } else
                        app_msgarg(&msgs, cp);
        }
 
-       if (!context_find("path"))
-               free(path("./", TFOLDER));
        if (!msgs.size)
                app_msgarg(&msgs, "all");
        if (!datesw)
                datesw = "date";
        if (!folder)
-               folder = getfolder(1);
-       maildir = m_maildir(folder);
+               folder = getcurfol();
+       maildir = toabsdir(folder);
 
        if (chdir(maildir) == NOTOK)
                adios(maildir, "unable to change directory to");
@@ -279,7 +277,7 @@ main(int argc, char **argv)
 
        rename_msgs(mp, dlist);
 
-       context_replace(pfolder, folder);  /* update current folder */
+       context_replace(curfolder, folder);  /* update current folder */
        seq_save(mp);  /* synchronize message sequences */
        context_save();  /* save the context file */
        folder_free(mp);  /* free folder/message structure */