From 682962d94b21e120c78a52a8bdcb6aa994330a14 Mon Sep 17 00:00:00 2001 From: markus schnalke Date: Fri, 9 Dec 2011 18:11:10 +0100 Subject: [PATCH] s/pfolder/curfolder/g --- config/config.c | 2 +- h/mh.h | 2 +- sbr/path.c | 2 +- uip/anno.c | 2 +- uip/burst.c | 2 +- uip/dist.c | 2 +- uip/flist.c | 38 ++++++++++++++++++-------------------- uip/folder.c | 8 ++++---- uip/forw.c | 2 +- uip/inc.c | 2 +- uip/install-mh.c | 2 +- uip/mark.c | 2 +- uip/mhlist.c | 2 +- uip/mhshow.c | 4 ++-- uip/mhstore.c | 2 +- uip/mhtest.c | 2 +- uip/new.c | 6 +++--- uip/packf.c | 2 +- uip/pick.c | 2 +- uip/refile.c | 4 ++-- uip/repl.c | 2 +- uip/rmf.c | 4 ++-- uip/rmm.c | 4 ++-- uip/scan.c | 2 +- uip/show.c | 2 +- uip/sortm.c | 2 +- 26 files changed, 52 insertions(+), 54 deletions(-) diff --git a/config/config.c b/config/config.c index 245ecde..7454666 100644 --- a/config/config.c +++ b/config/config.c @@ -112,7 +112,7 @@ char *draftfolder = "+drafts"; 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"; diff --git a/h/mh.h b/h/mh.h index 4b846cf..8ca6c44 100644 --- a/h/mh.h +++ b/h/mh.h @@ -329,7 +329,7 @@ extern char *nmhprivcache; extern char *nsequence; extern char *packproc; extern char *postproc; -extern char *pfolder; +extern char *curfolder; extern char *psequence; extern char *rcvdistcomps; extern char *rcvstoreproc; diff --git a/sbr/path.c b/sbr/path.c index 4132896..ca3595a 100644 --- a/sbr/path.c +++ b/sbr/path.c @@ -122,7 +122,7 @@ getdeffol(void) char * getcurfol(void) { - char *folder = context_find(pfolder); + char *folder = context_find(curfolder); if (!folder || !*folder) { folder = getdeffol(); diff --git a/uip/anno.c b/uip/anno.c index ec3590c..1d27a9e 100644 --- a/uip/anno.c +++ b/uip/anno.c @@ -242,7 +242,7 @@ main(int argc, char **argv) } } - 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 */ diff --git a/uip/burst.c b/uip/burst.c index b5414ad..ec50708 100644 --- a/uip/burst.c +++ b/uip/burst.c @@ -162,7 +162,7 @@ main(int argc, char **argv) } 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 diff --git a/uip/dist.c b/uip/dist.c index 991f5cd..27be4a5 100644 --- a/uip/dist.c +++ b/uip/dist.c @@ -192,7 +192,7 @@ main(int argc, char **argv) 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 */ diff --git a/uip/flist.c b/uip/flist.c index d85ad61..d2a0490 100644 --- a/uip/flist.c +++ b/uip/flist.c @@ -91,9 +91,9 @@ static int alphaOrder = FALSE; /* want alphabetical order only */ 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 */ /* @@ -236,7 +236,7 @@ main(int argc, char **argv) } /* get current folder */ - strncpy(curfolder, getcurfol(), sizeof(curfolder)); + strncpy(curfol, getcurfol(), sizeof(curfol)); /* get nmh base directory */ nmhdir = toabsdir("+"); @@ -267,7 +267,8 @@ main(int argc, char **argv) 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; @@ -323,9 +324,8 @@ ScanFolders(void) 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 */ /* @@ -337,20 +337,14 @@ ScanFolders(void) 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); } } } @@ -448,7 +442,8 @@ BuildFolderListRecurse(char *dirName, struct stat *s, int searchdepth) if (AddFolder(name, showzero) && (recurse || searchdepth) && st.st_nlink > 2) - BuildFolderListRecurse(name, &st, searchdepth - 1); + BuildFolderListRecurse(name, &st, + searchdepth - 1); } } closedir(dir); @@ -572,7 +567,10 @@ PrintFolders(void) 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; } @@ -583,7 +581,7 @@ PrintFolders(void) 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 diff --git a/uip/folder.c b/uip/folder.c index 70f497d..e219109 100644 --- a/uip/folder.c +++ b/uip/folder.c @@ -311,7 +311,7 @@ main(int argc, char **argv) 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; } @@ -352,14 +352,14 @@ main(int argc, char **argv) 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(); } /* @@ -382,7 +382,7 @@ main(int argc, char **argv) if (get_folder_info(folder, msg) && argfolder) { /* update current folder */ - context_replace(pfolder, argfolder); + context_replace(curfolder, argfolder); } } diff --git a/uip/forw.c b/uip/forw.c index 3f940f7..3ce0b21 100644 --- a/uip/forw.c +++ b/uip/forw.c @@ -349,7 +349,7 @@ main(int argc, char **argv) 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 */ diff --git a/uip/inc.c b/uip/inc.c index 2a866e9..54eb70e 100644 --- a/uip/inc.c +++ b/uip/inc.c @@ -506,7 +506,7 @@ main(int argc, char **argv) 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; diff --git a/uip/install-mh.c b/uip/install-mh.c index 1fb6834..30ac8f6 100644 --- a/uip/install-mh.c +++ b/uip/install-mh.c @@ -201,7 +201,7 @@ query: ctxpath = getcpy(toabsdir(context = "context")); /* Initialize current folder to default */ - context_replace(pfolder, defaultfolder); + context_replace(curfolder, defaultfolder); context_save(); /* diff --git a/uip/mark.c b/uip/mark.c index 5fd27f6..2914a44 100644 --- a/uip/mark.c +++ b/uip/mark.c @@ -221,7 +221,7 @@ main(int argc, char **argv) } 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); diff --git a/uip/mhlist.c b/uip/mhlist.c index b87e522..c12a6b9 100644 --- a/uip/mhlist.c +++ b/uip/mhlist.c @@ -361,7 +361,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 */ diff --git a/uip/mhshow.c b/uip/mhshow.c index 3510120..07a05a9 100644 --- a/uip/mhshow.c +++ b/uip/mhshow.c @@ -446,8 +446,8 @@ do_cache: /* 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 */ } diff --git a/uip/mhstore.c b/uip/mhstore.c index 1fbd50e..8ce7d62 100644 --- a/uip/mhstore.c +++ b/uip/mhstore.c @@ -375,7 +375,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 */ diff --git a/uip/mhtest.c b/uip/mhtest.c index df5985f..1f6846b 100644 --- a/uip/mhtest.c +++ b/uip/mhtest.c @@ -353,7 +353,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 */ diff --git a/uip/new.c b/uip/new.c index fc87b3a..c4026ba 100644 --- a/uip/new.c +++ b/uip/new.c @@ -513,7 +513,7 @@ main(int argc, char **argv) } sequences[i] = NULL; - folder = doit(context_find(pfolder), folders, sequences); + folder = doit(context_find(curfolder), folders, sequences); if (folder == NULL) { done(0); return 1; @@ -527,11 +527,11 @@ main(int argc, char **argv) ** 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); diff --git a/uip/packf.c b/uip/packf.c index b48a92d..9bb61f5 100644 --- a/uip/packf.c +++ b/uip/packf.c @@ -169,7 +169,7 @@ main(int argc, char **argv) /* 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); diff --git a/uip/pick.c b/uip/pick.c index 2efac42..e8720df 100644 --- a/uip/pick.c +++ b/uip/pick.c @@ -288,7 +288,7 @@ main(int argc, char **argv) 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 */ diff --git a/uip/refile.c b/uip/refile.c index 32b7f15..b85186a 100644 --- a/uip/refile.c +++ b/uip/refile.c @@ -231,7 +231,7 @@ main(int argc, char **argv) ** directory. This should be moved to folder_delmsgs(). */ if (rmmproc) { - context_replace(pfolder, folder); + context_replace(curfolder, folder); context_save(); fflush(stdout); } @@ -253,7 +253,7 @@ main(int argc, char **argv) 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); diff --git a/uip/repl.c b/uip/repl.c index 058b536..ff936bc 100644 --- a/uip/repl.c +++ b/uip/repl.c @@ -329,7 +329,7 @@ main(int argc, char **argv) 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 */ diff --git a/uip/rmf.c b/uip/rmf.c index 7d81a39..00104cf 100644 --- a/uip/rmf.c +++ b/uip/rmf.c @@ -111,11 +111,11 @@ main(int argc, char **argv) } 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 */ diff --git a/uip/rmm.c b/uip/rmm.c index e599f6f..c1b1608 100644 --- a/uip/rmm.c +++ b/uip/rmm.c @@ -109,7 +109,7 @@ main(int argc, char **argv) ** folder_delmsgs(). */ if (rmmproc) { - context_replace(pfolder, folder); + context_replace(curfolder, folder); context_save(); fflush(stdout); } @@ -118,7 +118,7 @@ main(int argc, char **argv) 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); diff --git a/uip/scan.c b/uip/scan.c index 1276d5b..5cac626 100644 --- a/uip/scan.c +++ b/uip/scan.c @@ -223,7 +223,7 @@ main(int argc, char **argv) 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 */ diff --git a/uip/show.c b/uip/show.c index 977b0e4..757b001 100644 --- a/uip/show.c +++ b/uip/show.c @@ -244,7 +244,7 @@ usage: 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) diff --git a/uip/sortm.c b/uip/sortm.c index 5132c1f..0caab30 100644 --- a/uip/sortm.c +++ b/uip/sortm.c @@ -277,7 +277,7 @@ main(int argc, char **argv) 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 */ -- 1.7.10.4