char *inbox = "Inbox";
char *defaultfolder = "+inbox";
-char *pfolder = "Current-Folder";
+char *curfolder = "Current-Folder";
char *usequence = "Unseen-Sequence";
char *psequence = "Previous-Sequence";
char *nsequence = "Sequence-Negation";
extern char *nsequence;
extern char *packproc;
extern char *postproc;
-extern char *pfolder;
+extern char *curfolder;
extern char *psequence;
extern char *rcvdistcomps;
extern char *rcvstoreproc;
char *
getcurfol(void)
{
- char *folder = context_find(pfolder);
+ char *folder = context_find(curfolder);
if (!folder || !*folder) {
folder = getdeffol();
}
}
- context_replace(pfolder, folder); /* update current folder */
+ context_replace(curfolder, folder); /* update current folder */
seq_setcur(mp, mp->lowsel); /* update current message */
seq_save(mp); /* synchronize message sequences */
folder_free(mp); /* free folder/message structure */
}
free((char *) smsgs);
- context_replace(pfolder, folder); /* update current folder */
+ context_replace(curfolder, folder); /* update current folder */
/*
** If -inplace is given, then the first message burst becomes
adios(msgnam, "unable to open message");
if (!file) {
- context_replace(pfolder, folder); /* update current folder */
+ context_replace(curfolder, folder); /* update current folder */
seq_setcur(mp, mp->lowsel); /* update current message */
seq_save(mp); /* synchronize sequences */
context_save(); /* save the context file */
static int recurse = FALSE; /* show nested folders? */
static int showzero = TRUE; /* show folders even if no messages in seq? */
static int Total = TRUE; /* display info on number of messages in
- * sequence found, and total num messages */
+ * sequence found, and total num messages */
-static char curfolder[BUFSIZ]; /* name of the current folder */
+static char curfol[BUFSIZ]; /* name of the current folder */
static char *nmhdir; /* base nmh mail directory */
/*
}
/* get current folder */
- strncpy(curfolder, getcurfol(), sizeof(curfolder));
+ strncpy(curfol, getcurfol(), sizeof(curfol));
/* get nmh base directory */
nmhdir = toabsdir("+");
GetFolderOrder();
ScanFolders();
- qsort(folders, nFolders, sizeof(struct Folder), (qsort_comp) CompareFolders);
+ qsort(folders, nFolders, sizeof(struct Folder),
+ (qsort_comp) CompareFolders);
PrintFolders();
done(0);
return 1;
if (numfolders > 0) {
/* Update context */
- strncpy(curfolder, foldersToDo[numfolders - 1],
- sizeof(curfolder));
- context_replace(pfolder, curfolder);/* update current folder */
+ strncpy(curfol, foldersToDo[numfolders - 1], sizeof(curfol));
+ context_replace(curfolder, curfol); /* update current folder */
context_save(); /* save the context file */
/*
BuildFolderList(foldersToDo[i], all ? 1 : 0);
} else {
if (all) {
- /*
- ** Do the readonly folders
- */
+ /* Do the readonly folders */
do_readonly_folders();
- /*
- ** Now scan the entire nmh directory for folders
- */
+ /* Now scan the entire nmh directory for folders */
BuildFolderList(".", 0);
} else {
- /*
- ** Else scan current folder
- */
- BuildFolderList(curfolder, 0);
+ /* Else scan current folder */
+ BuildFolderList(curfol, 0);
}
}
}
if (AddFolder(name, showzero) &&
(recurse || searchdepth) &&
st.st_nlink > 2)
- BuildFolderListRecurse(name, &st, searchdepth - 1);
+ BuildFolderListRecurse(name, &st,
+ searchdepth - 1);
}
}
closedir(dir);
if (folders[i].nSeq[j] > maxseq)
maxseq = folders[i].nSeq[j];
- /* check if this sequence is private in any of the folders */
+ /*
+ ** check if this sequence is private in any of
+ ** the folders
+ */
if (folders[i].private[j])
has_private = 1;
}
for (j = 0; j < numsequences; j++) {
if (folders[i].nSeq[j] > 0 || showzero) {
/* Add `+' to end of name of current folder */
- if (strcmp(curfolder, folders[i].name))
+ if (strcmp(curfol, folders[i].name))
snprintf(tmpname, sizeof(tmpname),
"%s", folders[i].name);
else
if (access(cp, F_OK) == NOTOK)
adios(cp, "unable to find folder");
/* update current folder */
- context_replace(pfolder, argfolder);
+ context_replace(curfolder, argfolder);
context_save(); /* save the context file */
argfolder = NULL;
}
if (msg)
admonish(NULL, "no folder given for message %s", msg);
readonly_folders(); /* do any readonly folders */
- strncpy(folder, (cp = context_find(pfolder)) ?
+ strncpy(folder, (cp = context_find(curfolder)) ?
cp : "", sizeof(folder));
crawl_folders(".", get_folder_info_callback, NULL);
} else {
strncpy(folder, argfolder, sizeof(folder));
if (get_folder_info(argfolder, msg)) {
/* update current folder */
- context_replace(pfolder, argfolder);
+ context_replace(curfolder, argfolder);
context_save();
}
/*
if (get_folder_info(folder, msg) && argfolder) {
/* update current folder */
- context_replace(pfolder, argfolder);
+ context_replace(curfolder, argfolder);
}
}
context_replace(buf, getcpy(value));
}
- context_replace(pfolder, folder); /* update current folder */
+ context_replace(curfolder, folder); /* update current folder */
seq_setcur(mp, mp->lowsel); /* update current message */
seq_save(mp); /* synchronize sequences */
context_save(); /* save the context file */
if (msgnum == hghnum) {
admonish(NULL, "no messages incorporated");
} else {
- context_replace(pfolder, folder); /* update current folder */
+ context_replace(curfolder, folder); /* update current folder */
if (chgflag)
mp->curmsg = hghnum + 1;
mp->hghmsg = msgnum;
ctxpath = getcpy(toabsdir(context = "context"));
/* Initialize current folder to default */
- context_replace(pfolder, defaultfolder);
+ context_replace(curfolder, defaultfolder);
context_save();
/*
}
seq_save(mp); /* synchronize message sequences */
- context_replace(pfolder, folder); /* update current folder */
+ context_replace(curfolder, folder); /* update current folder */
context_save(); /* save the context file */
folder_free(mp); /* free folder/message structure */
done(0);
/* 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 */
/* If reading from a folder, do some updating */
if (mp) {
- context_replace(pfolder, folder); /* update current folder */
- seq_setcur(mp, mp->hghsel); /* update current message */
+ 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 */
}
/* 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 */
/* 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 */
}
sequences[i] = NULL;
- folder = doit(context_find(pfolder), folders, sequences);
+ folder = doit(context_find(curfolder), folders, sequences);
if (folder == NULL) {
done(0);
return 1;
** has in memory. So, we'll be lame, too. I'm not sure if i
** should just change context_replace...
*/
- context_replace(pfolder, "defeat_context_replace_optimization");
+ context_replace(curfolder, "defeat_context_replace_optimization");
}
/* update current folder */
- context_replace(pfolder, folder->n_name);
+ context_replace(curfolder, folder->n_name);
if (run_mode == FNEXT || run_mode == FPREV) {
printf("%s %s\n", folder->n_name, folder->n_field);
/* close and unlock maildrop file */
mbx_close(file, md);
- context_replace(pfolder, folder); /* update current folder */
+ context_replace(curfolder, folder); /* update current folder */
if (mp->hghsel != mp->curmsg)
seq_setcur(mp, mp->lowsel);
seq_save(mp);
printf("%d hit%s\n", mp->numsel, mp->numsel == 1 ? "" : "s");
}
- context_replace(pfolder, folder); /* update current folder */
+ context_replace(curfolder, folder); /* update current folder */
seq_save(mp); /* synchronize message sequences */
context_save(); /* save the context file */
folder_free(mp); /* free folder/message structure */
** directory. This should be moved to folder_delmsgs().
*/
if (rmmproc) {
- context_replace(pfolder, folder);
+ context_replace(curfolder, folder);
context_save();
fflush(stdout);
}
seq_setcur(mp, mp->hghsel);
seq_save(mp); /* synchronize message sequences */
- context_replace(pfolder, folder); /* update current folder */
+ context_replace(curfolder, folder); /* update current folder */
context_save(); /* save the context file */
folder_free(mp); /* free folder structure */
done(0);
if (mp->numsel > 1)
adios(NULL, "only one message at a time!");
- context_replace(pfolder, folder); /* update current folder */
+ context_replace(curfolder, folder); /* update current folder */
seq_setcur(mp, mp->lowsel); /* update current message */
seq_save(mp); /* synchronize sequences */
context_save(); /* save the context file */
}
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 */
** folder_delmsgs().
*/
if (rmmproc) {
- context_replace(pfolder, folder);
+ context_replace(curfolder, folder);
context_save();
fflush(stdout);
}
folder_delmsgs(mp, unlink_msgs, 0);
seq_save(mp); /* synchronize message sequences */
- context_replace(pfolder, folder); /* update current folder */
+ context_replace(curfolder, folder); /* update current folder */
context_save(); /* save the context file */
folder_free(mp); /* free folder structure */
done(0);
done(1);
seq_setprev(mp); /* set the Previous-Sequence */
- context_replace(pfolder, folder); /* update current folder */
+ context_replace(curfolder, folder); /* update current folder */
seq_save(mp); /* synchronize message sequences */
context_save(); /* save the context file */
seq_setcur(mp, mp->hghsel); /* update current message */
seq_save(mp); /* synchronize sequences */
- context_replace(pfolder, folder); /* update current folder */
+ context_replace(curfolder, folder); /* update current folder */
context_save(); /* save the context file */
if (headersw && vecp == 2)
rename_msgs(mp, dlist);
- context_replace(pfolder, folder); /* update current folder */
+ context_replace(curfolder, folder); /* update current folder */
seq_save(mp); /* synchronize message sequences */
context_save(); /* save the context file */
folder_free(mp); /* free folder/message structure */