*
* This code is Copyright (c) 2002, by the authors of nmh. See the
* COPYRIGHT file in the root directory of the nmh distribution for
*
* This code is Copyright (c) 2002, by the authors of nmh. See the
* COPYRIGHT file in the root directory of the nmh distribution for
int defolder = 0, interactive = -1;
char *cp, *folder = NULL, newfolder[BUFSIZ];
char buf[BUFSIZ], **argp, **arguments;
int defolder = 0, interactive = -1;
char *cp, *folder = NULL, newfolder[BUFSIZ];
char buf[BUFSIZ], **argp, **arguments;
arguments = getarguments (invo_name, argc, argv, 1);
argp = arguments;
arguments = getarguments (invo_name, argc, argv, 1);
argp = arguments;
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [switches]",
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [switches]",
- adios (NULL, "only one folder at a time!");
- else
- folder = pluspath (cp);
+ die("only one folder at a time!");
+ folder = pluspath (cp);
- if (strcmp (m_mailpath (folder), pwd ()) == 0)
- adios (NULL, "sorry, you can't remove the current working directory");
+ fp = m_mailpath(folder);
+ if (!strcmp(fp, pwd()))
+ die("sorry, you can't remove the current working directory");
+ free(fp);
switch (i = chdir (maildir = m_maildir (folder))) {
case OK:
if (access (".", W_OK) != NOTOK && access ("..", W_OK) != NOTOK)
switch (i = chdir (maildir = m_maildir (folder))) {
case OK:
if (access (".", W_OK) != NOTOK && access ("..", W_OK) != NOTOK)
- snprintf (cur, sizeof(cur), "atr-%s-%s",
- current, m_mailpath (folder));
+ fp = m_mailpath(folder);
+ snprintf (cur, sizeof(cur), "atr-%s-%s", current, fp);
+ free(fp);
if (!context_del (cur)) {
printf ("[+%s de-referenced]\n", folder);
return OK;
}
if (!context_del (cur)) {
printf ("[+%s de-referenced]\n", folder);
return OK;
}
i == NOTOK ? "unreadable" : "read-only", folder);
return NOTOK;
}
if ((dd = opendir (".")) == NULL)
i == NOTOK ? "unreadable" : "read-only", folder);
return NOTOK;
}
if ((dd = opendir (".")) == NULL)
while ((dp = readdir (dd))) {
switch (dp->d_name[0]) {
case '.':
if (strcmp (dp->d_name, ".") == 0
|| strcmp (dp->d_name, "..") == 0)
while ((dp = readdir (dd))) {
switch (dp->d_name[0]) {
case '.':
if (strcmp (dp->d_name, ".") == 0
|| strcmp (dp->d_name, "..") == 0)
&& *(np->n_name + j) == '-'
&& strcmp (cp, np->n_name + j + 1) == 0) {
if (!np->n_context)
&& *(np->n_name + j) == '-'
&& strcmp (cp, np->n_name + j + 1) == 0) {
if (!np->n_context)