Completely reworked the path convertion functions
[mmh] / uip / rmf.c
index 3b532e0..7d81a39 100644 (file)
--- a/uip/rmf.c
+++ b/uip/rmf.c
@@ -74,7 +74,7 @@ main(int argc, char **argv)
                        if (folder)
                                adios(NULL, "only one folder at a time!");
                        else
-                               folder = pluspath(cp);
+                               folder = getcpy(expandfol(cp));
                } else {
                        adios(NULL, "usage: %s [+folder] [switches]",
                                        invo_name);
@@ -82,11 +82,11 @@ main(int argc, char **argv)
        }
 
        if (!folder) {
-               folder = getfolder(FCUR);
+               folder = getcurfol();
                defolder++;
        }
-       if (strcmp(m_mailpath(folder), pwd()) == 0)
-               adios(NULL, "sorry, you can't remove the current working directory");
+       if (strcmp(toabsdir(folder), pwd()) == 0)
+               adios(NULL, "You can't remove the current working directory");
 
        if (interactive == -1)
                interactive = defolder;
@@ -98,9 +98,9 @@ main(int argc, char **argv)
                if (cp > newfolder)
                        *cp = '\0';
                else
-                       strncpy(newfolder, getfolder(FDEF), sizeof(newfolder));
+                       strncpy(newfolder, getdeffol(), sizeof(newfolder));
        } else {
-               strncpy(newfolder, getfolder(FDEF), sizeof(newfolder));
+               strncpy(newfolder, getdeffol(), sizeof(newfolder));
        }
 
        if (interactive) {
@@ -132,7 +132,7 @@ rmf(char *folder)
        register struct dirent *dp;
        register DIR *dd;
 
-       switch (i = chdir(maildir = m_maildir(folder))) {
+       switch (i = chdir(maildir = toabsdir(folder))) {
                case OK:
                        if (access(".", W_OK) != NOTOK &&
                                        access("..", W_OK) != NOTOK)
@@ -140,7 +140,7 @@ rmf(char *folder)
 
                case NOTOK:
                        snprintf(cur, sizeof(cur), "atr-%s-%s",
-                                               current, m_mailpath(folder));
+                                               current, toabsdir(folder));
                        if (!context_del(cur)) {
                                printf("[+%s de-referenced]\n", folder);
                                return OK;
@@ -232,7 +232,7 @@ rma(char *folder)
        register struct node *np, *pp;
 
        alen = strlen("atr-");
-       plen = strlen(cp = m_mailpath(folder)) + 1;
+       plen = strlen(cp = getcpy(toabsdir(folder))) + 1;
 
        /*
        ** Search context list for keys that look like
@@ -257,4 +257,5 @@ rma(char *folder)
                        pp = np;
                }
        }
+       free(cp);
 }