Completely reworked the path convertion functions
[mmh] / uip / flist.c
index 0f44555..d85ad61 100644 (file)
@@ -128,7 +128,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();
@@ -229,21 +229,17 @@ main(int argc, char **argv)
                                foldersToDo = (char **) mh_xrealloc(foldersToDo, (size_t) (maxfolders * sizeof(*foldersToDo)));
                        }
                        if (*cp == '+' || *cp == '@') {
-                               foldersToDo[numfolders++] =
-                                       pluspath(cp);
+                               foldersToDo[numfolders++] = getcpy(expandfol(cp));
                        } else
                                foldersToDo[numfolders++] = cp;
                }
        }
 
-       if (!context_find("path"))
-               free(path("./", TFOLDER));
-
        /* get current folder */
-       strncpy(curfolder, getfolder(1), sizeof(curfolder));
+       strncpy(curfolder, getcurfol(), sizeof(curfolder));
 
        /* get nmh base directory */
-       nmhdir = m_maildir("");
+       nmhdir = toabsdir("+");
 
        /*
        ** If we didn't specify any sequences, we search
@@ -691,7 +687,7 @@ do_readonly_folders(void)
        atrlen = strlen(atrcur);
 
        for (np = m_defs; np; np = np->n_next)
-               if (ssequal(atrcur, np->n_name)
-                               && !ssequal(nmhdir, np->n_name + atrlen))
+               if (isprefix(atrcur, np->n_name)
+                               && !isprefix(nmhdir, np->n_name + atrlen))
                        BuildFolderList(np->n_name + atrlen, 0);
 }