X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=uip%2Fmhstore.c;h=c1a3edbe54489fbd1e3b90dfb5d3fb6e65778a6d;hb=84c6039eb7226c0ba0a8f708205e33d10950d2ae;hp=dd5f51788989a7bdf511d905a96830aff13a5e1d;hpb=714b5c530ece27ea2835a313013f5b770163403c;p=mmh diff --git a/uip/mhstore.c b/uip/mhstore.c index dd5f517..c1a3edb 100644 --- a/uip/mhstore.c +++ b/uip/mhstore.c @@ -12,7 +12,6 @@ #include #include #include -#include #include #include #include @@ -125,7 +124,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(); @@ -209,7 +208,7 @@ do_cache: if (!(cp = *argp++) || (*cp == '-' && cp[1])) adios(NULL, "missing argument to %s", argp[-2]); - file = *cp == '-' ? cp : path(cp, TFILE); + file = *cp == '-' ? cp : getcpy(expanddir(cp)); continue; case VERBSW: @@ -227,9 +226,9 @@ do_cache: if (folder) adios(NULL, "only one folder at a time!"); else - folder = pluspath(cp); + folder = getcpy(expandfol(cp)); } else - app_msgarg(&msgs, cp); + app_msgarg(&msgs, cp); } /* null terminate the list of acceptable parts/types */ @@ -266,7 +265,7 @@ do_cache: /* Check for private cache location */ if (!(cache_private = context_find(nmhprivcache))) cache_private = ".cache"; - cache_private = getcpy(m_maildir(cache_private)); + cache_private = getcpy(toabsdir(cache_private)); /* ** Cache the current directory before we do any chdirs()'s. @@ -281,10 +280,7 @@ do_cache: if ((cp = context_find(nmhstorage)) && *cp) tmp = concat(cp, "/", invo_name, NULL); else - tmp = add(m_maildir(invo_name), NULL); - - if (!context_find("path")) - free(path("./", TFOLDER)); + tmp = getcpy(toabsdir(invo_name)); if (file && msgs.size) adios(NULL, "cannot specify msg and file at same time!"); @@ -304,10 +300,10 @@ do_cache: ** message(s) are coming from a folder */ if (!msgs.size) - app_msgarg(&msgs, "cur"); + app_msgarg(&msgs, seq_cur); 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"); @@ -378,7 +374,7 @@ do_cache: /* If reading from a folder, do some updating */ if (mp) { - context_replace(pfolder, folder); /* update current folder */ + context_replace(curfolder, folder); /* update current folder */ seq_setcur(mp, mp->hghsel); /* update current message */ seq_save(mp); /* synchronize sequences */ context_save(); /* save the context file */