]> diplodocus.org Git - nmh/blobdiff - uip/msh.c
Fix up a few warnings and problems.
[nmh] / uip / msh.c
index 98f9afe92cafca9a5ce16f54fa74e7244fece631..2fb2b23092553f72dfc69b3de0c0a5b2d5a542e4 100644 (file)
--- a/uip/msh.c
+++ b/uip/msh.c
@@ -26,7 +26,6 @@
 
 #include <pwd.h>
 #include <setjmp.h>
-#include <signal.h>
 #include <h/msh.h>
 #include <h/vmhsbr.h>
 
@@ -604,7 +603,7 @@ fsetup (char *folder)
        padios (maildir, "unable to change directory to");
 
     /* read folder and create message structure */
-    if (!(mp = folder_read (folder)))
+    if (!(mp = folder_read (folder, 0)))
        padios (NULL, "unable to read folder %s", folder);
 
     /* check for empty folder */
@@ -682,8 +681,7 @@ setup (char *file)
     }
     m_init ();
 
-    mp->msgattrs[0] = getcpy ("unseen");
-    mp->msgattrs[1] = NULL;
+    svector_push_back (mp->msgattrs, getcpy ("unseen"));
 
     scan_detect_mbox_style (fp);               /* the MAGIC invocation */
     if (fmsh) {
@@ -808,6 +806,7 @@ msh_ready (int msgnum, int full)
        return yp;
     }
 
+    scan_reset_m_getfld_state ();
     scan_eom_action ((int (*)()) 0);   /* XXX */
     fseek (fp, Msgs[msgnum].m_start, SEEK_SET);
     return fp;
@@ -830,7 +829,7 @@ check_folder (int scansw)
        low = mp->hghmsg + 1;
        folder_free (mp);               /* free folder/message structure */
 
-       if (!(mp = folder_read (fmsh)))
+       if (!(mp = folder_read (fmsh, 0)))
            padios (NULL, "unable to re-read folder %s", fmsh);
 
        hgh = mp->hghmsg;
@@ -982,7 +981,7 @@ readid (int msgnum)
        switch (state = m_getfld (&gstate, name, buf, &bufsz, zp)) {
            case FLD: 
            case FLDPLUS: 
-               if (!mh_strcasecmp (name, BBoard_ID)) {
+               if (!strcasecmp (name, BBoard_ID)) {
                    bp = getcpy (buf);
                    while (state == FLDPLUS) {
                        bufsz = sizeof buf;
@@ -1096,7 +1095,7 @@ quit (void)
     if (vmh) 
        ttyNaux (NULLCMD, "FAST");
     cp = NULL;
-    if ((dp = lkfopen (mp->foldpath, "r")) == NULL) {
+    if ((dp = lkfopendata (mp->foldpath, "r")) == NULL) {
        advise (mp->foldpath, "unable to lock");
        if (vmh) {
            ttyR (NULLCMD);
@@ -1160,7 +1159,7 @@ quit (void)
 release: ;
     if (cp)
        free (cp);
-    lkfclose (dp, mp->foldpath);
+    lkfclosedata (dp, mp->foldpath);
     if (vmh) {
        ttyR (NULLCMD);
        pFIN ();
@@ -1273,8 +1272,7 @@ static int
 parse (char *buffer, struct Cmd *cmdp)
 {
     int argp = 0;
-    unsigned char c, *cp;
-    char *pp;
+    char c, *cp, *pp;
 
     cmdp->line[0] = 0;
     pp = cmdp->args[argp++] = cmdp->line;
@@ -1283,7 +1281,7 @@ parse (char *buffer, struct Cmd *cmdp)
     cmdp->stream = NULL;
 
     for (cp = buffer; (c = *cp); cp++) {
-       if (!isspace (c))
+       if (!isspace ((unsigned char) c))
            break;
     }
     if (c == '\0') {
@@ -1293,8 +1291,8 @@ parse (char *buffer, struct Cmd *cmdp)
     }
 
     while ((c = *cp++)) {
-       if (isspace (c)) {
-           while (isspace (c))
+       if (isspace ((unsigned char) c)) {
+           while (isspace ((unsigned char) c))
                c = *cp++;
            if (c == 0)
                break;
@@ -1349,7 +1347,7 @@ parse (char *buffer, struct Cmd *cmdp)
                }
                cmdp->redirect = pp + 1;/* sigh */
                for (; (c = *cp); cp++)
-                   if (!isspace (c))
+                   if (!isspace ((unsigned char) c))
                        break;
                if (c == 0) {
                    padvise (NULL, cmdp->direction != PIPIO
@@ -1360,7 +1358,7 @@ parse (char *buffer, struct Cmd *cmdp)
                strcpy (cmdp->redirect, cp);
                if (cmdp->direction != PIPIO) {
                    for (; *cp; cp++)
-                       if (isspace (*cp)) {
+                       if (isspace ((unsigned char) *cp)) {
                            padvise (NULL, "bad name for redirect");
                            return NOTOK;
                        }
@@ -1592,7 +1590,7 @@ static int
 pINI (void)
 {
     int i, vrsn;
-    unsigned char *bp;
+    char *bp;
     struct record rcs, *rc;
 
     rc = &rcs;
@@ -1601,7 +1599,7 @@ pINI (void)
     switch (peer2rc (rc)) {
        case RC_INI: 
            bp = rc->rc_data;
-           while (isspace (*bp))
+           while (isspace ((unsigned char) *bp))
                bp++;
            if (sscanf (bp, "%d", &vrsn) != 1) {
        bad_init: ;
@@ -1613,9 +1611,9 @@ pINI (void)
                done (1);
            }
 
-           while (*bp && !isspace (*bp))
+           while (*bp && !isspace ((unsigned char) *bp))
                bp++;
-           while (isspace (*bp))
+           while (isspace ((unsigned char) *bp))
                bp++;
            if (sscanf (bp, "%d", &numwins) != 1 || numwins <= 0)
                goto bad_init;
@@ -1623,9 +1621,9 @@ pINI (void)
                numwins = NWIN;
 
            for (i = 1; i <= numwins; i++) {
-               while (*bp && !isspace (*bp))
+               while (*bp && !isspace ((unsigned char) *bp))
                    bp++;
-               while (isspace (*bp))
+               while (isspace ((unsigned char) *bp))
                    bp++;
                if (sscanf (bp, "%d", &windows[i]) != 1 || windows[i] <= 0)
                    goto bad_init;