#define TFILE 1 /* path() given a file */
#define TSUBCWF 2 /* path() given a @folder */
+#define FDEF 0 /* getfolder() want default */
+#define FCUR 1 /* getfolder() want current */
+
#define OUTPUTLINELEN 72 /* default line length for headers */
/*
/* use current folder if none is specified */
if (folder == NULL)
- folder = getfolder(1);
+ folder = getfolder(FCUR);
if (!(*folder != '/' && strncmp(folder, CWD, NCWD)
&& strcmp(folder, DOT) && strcmp(folder, DOTDOT)
if (type == TSUBCWF) {
/* @folder to +folder */
- snprintf(buffer, sizeof(buffer), "%s/%s", getfolder(1), name);
+ snprintf(buffer, sizeof(buffer), "%s/%s",
+ getfolder(FCUR), name);
name = m_mailpath(buffer);
packpath(name);
snprintf(buffer, sizeof(buffer), "%s/", m_maildir(""));
if (!msgs.size)
app_msgarg(&msgs, "cur");
if (!folder)
- folder = getfolder(1);
+ folder = getfolder(FCUR);
maildir = m_maildir(folder);
if (chdir(maildir) == NOTOK)
if (!msgp)
msgs[msgp++] = "cur";
if (!folder)
- folder = getfolder(1);
+ folder = getfolder(FCUR);
maildir = m_maildir(folder);
if (chdir(maildir) == NOTOK)
if (!msg)
msg = "cur";
if (!folder)
- folder = getfolder(1);
+ folder = getfolder(FCUR);
maildir = m_maildir(folder);
if (chdir(maildir) == NOTOK)
if (!msg)
msg = "cur";
if (!folder)
- folder = getfolder(1);
+ folder = getfolder(FCUR);
maildir = m_maildir(folder);
if (chdir(maildir) == NOTOK)
free(path("./", TFOLDER));
/* get current folder */
- strncpy(curfolder, getfolder(1), sizeof(curfolder));
+ strncpy(curfolder, getfolder(FCUR), sizeof(curfolder));
/* get nmh base directory */
nmhdir = m_maildir("");
} else {
adios(NULL, "no other folder");
}
- for (cp = getcpy(getfolder(1)); *ap; ap++)
+ for (cp = getcpy(getfolder(FCUR)); *ap; ap++)
cp = add(*ap, add(" ", cp));
free(dp);
context_replace(stack, cp); /* update folder stack */
} else {
/* update folder stack */
context_replace(stack, (cp = context_find (stack)) ?
- concat(getfolder(1), " ", cp, NULL) :
- getcpy(getfolder(1)));
+ concat(getfolder(FCUR), " ", cp, NULL) :
+ getcpy(getfolder(FCUR)));
}
}
/* Listing the folder stack */
if (listsw) {
- printf("%s", argfolder ? argfolder : getfolder(1));
+ printf("%s", argfolder ? argfolder : getfolder(FCUR));
if ((cp = context_find(stack))) {
dp = getcpy(cp);
for (ap = brkstring(dp, " ", "\n"); *ap; ap++)
if (!msgp)
msgs[msgp++] = "cur";
if (!folder)
- folder = getfolder(1);
+ folder = getfolder(FCUR);
maildir = m_maildir(folder);
if (chdir(maildir) == NOTOK)
if (!context_find("path"))
free(path("./", TFOLDER));
if (!folder)
- folder = getfolder(0);
+ folder = getfolder(FDEF);
maildir = m_maildir(folder);
if ((maildir_copy = strdup(maildir)) == (char *)0)
if (!msgs.size)
app_msgarg(&msgs, listsw ? "all" :"cur");
if (!folder)
- folder = getfolder(1);
+ folder = getfolder(FCUR);
maildir = m_maildir(folder);
if (chdir(maildir) == NOTOK)
/* else, use the current folder */
if (!folder)
- folder = add(getfolder(1), NULL);
+ folder = add(getfolder(FCUR), NULL);
if (!(mp = folder_read(folder)))
adios(NULL, "unable to read folder %s", folder);
if (!msgs.size)
app_msgarg(&msgs, "cur");
if (!folder)
- folder = getfolder(1);
+ folder = getfolder(FCUR);
maildir = m_maildir(folder);
if (chdir(maildir) == NOTOK)
free(path("./", TFOLDER));
if (!folder)
- folder = getfolder(1);
+ folder = getfolder(FCUR);
maildir = m_maildir(folder);
/* If no messages are given, print folder pathname */
if (!msgs.size)
app_msgarg(&msgs, "cur");
if (!folder)
- folder = getfolder(1);
+ folder = getfolder(FCUR);
maildir = m_maildir(folder);
if (chdir(maildir) == NOTOK)
if (!msgs.size)
app_msgarg(&msgs, "cur");
if (!folder)
- folder = getfolder(1);
+ folder = getfolder(FCUR);
maildir = m_maildir(folder);
if (chdir(maildir) == NOTOK)
if (cp[1])
folder = pluspath(cp);
else
- folder = getfolder(1);
+ folder = getfolder(FCUR);
/* Check if folder exists */
create_folder(m_mailpath(folder), 0, exit);
if (!msgs.size)
app_msgarg(&msgs, "cur");
if (!folder)
- folder = getfolder(1);
+ folder = getfolder(FCUR);
maildir = m_maildir(folder);
if (chdir(maildir) == NOTOK)
app_msgarg(&msgs, "all");
if (!folder)
- folder = getfolder(1);
+ folder = getfolder(FCUR);
maildir = m_maildir(folder);
if (chdir(maildir) == NOTOK)
app_msgarg(&msgs, "all");
if (!folder)
- folder = getfolder(1);
+ folder = getfolder(FCUR);
maildir = m_maildir(folder);
if (chdir(maildir) == NOTOK)
/* if no folder is given, use default folder */
if (!folder)
- folder = getfolder(0);
+ folder = getfolder(FDEF);
maildir = m_maildir(folder);
/* check if folder exists */
if (!msgs.size)
app_msgarg(&msgs, "cur");
if (!folder)
- folder = getfolder(1);
+ folder = getfolder(FCUR);
strncpy(maildir, m_maildir(folder), sizeof(maildir));
if (chdir(maildir) == NOTOK)
if (!msg)
msg = "cur";
if (!folder)
- folder = getfolder(1);
+ folder = getfolder(FCUR);
maildir = m_maildir(folder);
if (chdir(maildir) == NOTOK)
if (!context_find("path"))
free(path("./", TFOLDER));
if (!folder) {
- folder = getfolder(1);
+ folder = getfolder(FCUR);
defolder++;
}
if (strcmp(m_mailpath(folder), pwd()) == 0)
if (cp > newfolder)
*cp = '\0';
else
- strncpy(newfolder, getfolder(0), sizeof(newfolder));
+ strncpy(newfolder, getfolder(FDEF), sizeof(newfolder));
} else {
- strncpy(newfolder, getfolder(0), sizeof(newfolder));
+ strncpy(newfolder, getfolder(FDEF), sizeof(newfolder));
}
if (interactive) {
if (!msgs.size)
app_msgarg(&msgs, "cur");
if (!folder)
- folder = getfolder(1);
+ folder = getfolder(FCUR);
maildir = m_maildir(folder);
if (chdir(maildir) == NOTOK)
if (!msgs.size)
app_msgarg(&msgs, "all");
if (!folder)
- folder = getfolder(1);
+ folder = getfolder(FCUR);
maildir = m_maildir(folder);
if (chdir(maildir) == NOTOK)
}
if (!folder)
- folder = getfolder(1);
+ folder = getfolder(FCUR);
maildir = m_maildir(folder);
if (chdir(maildir) == NOTOK)
if (!datesw)
datesw = "date";
if (!folder)
- folder = getfolder(1);
+ folder = getfolder(FCUR);
maildir = m_maildir(folder);
if (chdir(maildir) == NOTOK)