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);
}
}
- if (!context_find("path"))
- free(path("./", TFOLDER));
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;
if (strchr(folder, '/') && (*folder != '/') && (*folder != '.')) {
- for (cp = copy(folder, newfolder);
- cp > newfolder && *cp != '/'; cp--)
- continue;
+ strcpy(newfolder, folder);
+ cp = newfolder + strlen(newfolder);
+ while (cp > newfolder && *cp != '/')
+ cp--;
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) {
}
if (rmf(folder) == OK) {
- char *cfolder = context_find(pfolder);
+ char *cfolder = context_find(curfolder);
if (cfolder && strcmp(cfolder, newfolder)) {
printf("[+%s now current]\n", newfolder);
/* update current folder */
- context_replace(pfolder, newfolder);
+ context_replace(curfolder, newfolder);
}
}
context_save(); /* save the context file */
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)
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;
** Run the external delete hook program.
*/
- (void)ext_hook("del-hook", maildir, (char *)0);
+ ext_hook("del-hook", maildir, NULL);
j = strlen(backup_prefix);
while ((dp = readdir(dd))) {
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
pp = np;
}
}
+ free(cp);
}