X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/de4636bb664106d9932ae7acb517e471b848f1f3..521674623:/uip/mhlist.c diff --git a/uip/mhlist.c b/uip/mhlist.c index 1363081c..f6208ddb 100644 --- a/uip/mhlist.c +++ b/uip/mhlist.c @@ -11,8 +11,6 @@ #include #include #include -#include -#include #include #include #include @@ -34,6 +32,8 @@ X("type content", 0, TYPESW) \ X("rcache policy", 0, RCACHESW) \ X("wcache policy", 0, WCACHESW) \ + X("changecur", 0, CHGSW) \ + X("nochangecur", 0, NCHGSW) \ X("version", 0, VERSIONSW) \ X("help", 0, HELPSW) \ X("debug", -5, DEBUGSW) \ @@ -86,7 +86,6 @@ void flush_errors (void); void list_all_messages (CT *, int, int, int, int); /* mhfree.c */ -void free_content (CT); extern CT *cts; void freects_done (int) NORETURN; @@ -99,7 +98,7 @@ static void pipeser (int); int main (int argc, char **argv) { - int sizesw = 1, headsw = 1; + int sizesw = 1, headsw = 1, chgflag = 1; int msgnum, *icachesw; char *cp, *file = NULL, *folder = NULL; char *maildir, buf[100], **argp; @@ -206,6 +205,13 @@ do_cache: file = *cp == '-' ? cp : path (cp, TFILE); continue; + case CHGSW: + chgflag++; + continue; + case NCHGSW: + chgflag = 0; + continue; + case VERBSW: verbosw = 1; continue; @@ -279,7 +285,7 @@ do_cache: adios (maildir, "unable to change directory to"); /* read folder and create message structure */ - if (!(mp = folder_read (folder))) + if (!(mp = folder_read (folder, 0))) adios (NULL, "unable to read folder %s", folder); /* check for empty folder */ @@ -344,7 +350,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 */ + if (chgflag) + seq_setcur (mp, mp->hghsel); /* update current message */ seq_save (mp); /* synchronize sequences */ context_save (); /* save the context file */ } @@ -358,7 +365,6 @@ static void pipeser (int i) { if (i == SIGQUIT) { - unlink ("core"); fflush (stdout); fprintf (stderr, "\n"); fflush (stderr);