]> diplodocus.org Git - nmh/blobdiff - uip/msh.c
Silenced warnings when built without iconv.
[nmh] / uip / msh.c
index 4ab73286825fa15e15dd331176ec62b24affa938..e91924c35db2275236cce48fdada9739a49df0b0 100644 (file)
--- a/uip/msh.c
+++ b/uip/msh.c
@@ -26,7 +26,6 @@
 
 #include <pwd.h>
 #include <setjmp.h>
 
 #include <pwd.h>
 #include <setjmp.h>
-#include <signal.h>
 #include <h/msh.h>
 #include <h/vmhsbr.h>
 
 #include <h/msh.h>
 #include <h/vmhsbr.h>
 
@@ -204,13 +203,7 @@ main (int argc, char **argv)
     char *cp, *file = NULL, *folder = NULL;
     char **argp, **arguments, buf[BUFSIZ];
 
     char *cp, *file = NULL, *folder = NULL;
     char **argp, **arguments, buf[BUFSIZ];
 
-#ifdef LOCALE
-    setlocale(LC_ALL, "");
-#endif
-    invo_name = r1bindex (argv[0], '/');
-
-    /* read user profile/context */
-    context_read();
+    if (nmh_init(argv[0], 1)) { return 1; }
 
     mts_init (invo_name);
     arguments = getarguments (invo_name, argc,argv, 1);
 
     mts_init (invo_name);
     arguments = getarguments (invo_name, argc,argv, 1);
@@ -604,7 +597,7 @@ fsetup (char *folder)
        padios (maildir, "unable to change directory to");
 
     /* read folder and create message structure */
        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 */
        padios (NULL, "unable to read folder %s", folder);
 
     /* check for empty folder */
@@ -682,8 +675,7 @@ setup (char *file)
     }
     m_init ();
 
     }
     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) {
 
     scan_detect_mbox_style (fp);               /* the MAGIC invocation */
     if (fmsh) {
@@ -831,7 +823,7 @@ check_folder (int scansw)
        low = mp->hghmsg + 1;
        folder_free (mp);               /* free folder/message structure */
 
        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;
            padios (NULL, "unable to re-read folder %s", fmsh);
 
        hgh = mp->hghmsg;
@@ -983,7 +975,7 @@ readid (int msgnum)
        switch (state = m_getfld (&gstate, name, buf, &bufsz, zp)) {
            case FLD: 
            case FLDPLUS: 
        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;
                    bp = getcpy (buf);
                    while (state == FLDPLUS) {
                        bufsz = sizeof buf;
@@ -1097,7 +1089,7 @@ quit (void)
     if (vmh) 
        ttyNaux (NULLCMD, "FAST");
     cp = NULL;
     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);
        advise (mp->foldpath, "unable to lock");
        if (vmh) {
            ttyR (NULLCMD);
@@ -1122,7 +1114,7 @@ quit (void)
                close (i);
            else
                advise (mp->foldpath, "error zero'ing");
                close (i);
            else
                advise (mp->foldpath, "error zero'ing");
-           unlink (map_name (mp->foldpath));/* XXX */
+           (void) m_unlink (map_name (mp->foldpath));/* XXX */
        }
        goto release;
     }
        }
        goto release;
     }
@@ -1139,8 +1131,8 @@ quit (void)
     for (msgnum = mp->lowmsg; msgnum <= mp->hghmsg; msgnum++)
        if (does_exist(mp, msgnum) && pack (tmpfil, md, msgnum) == NOTOK) {
            mbx_close (tmpfil, md);
     for (msgnum = mp->lowmsg; msgnum <= mp->hghmsg; msgnum++)
        if (does_exist(mp, msgnum) && pack (tmpfil, md, msgnum) == NOTOK) {
            mbx_close (tmpfil, md);
-           unlink (tmpfil);
-           unlink (map_name (tmpfil));
+           (void) m_unlink (tmpfil);
+           (void) m_unlink (map_name (tmpfil));
            goto release;
        }
     mbx_close (tmpfil, md);
            goto release;
        }
     mbx_close (tmpfil, md);
@@ -1153,15 +1145,15 @@ quit (void)
 
        if (rename (map1, map2) == NOTOK) {
            admonish (map2, "unable to rename %s to", map1);
 
        if (rename (map1, map2) == NOTOK) {
            admonish (map2, "unable to rename %s to", map1);
-           unlink (map1);
-           unlink (map2);
+           (void) m_unlink (map1);
+           (void) m_unlink (map2);
        }
     }
 
 release: ;
     if (cp)
        free (cp);
        }
     }
 
 release: ;
     if (cp)
        free (cp);
-    lkfclose (dp, mp->foldpath);
+    lkfclosedata (dp, mp->foldpath);
     if (vmh) {
        ttyR (NULLCMD);
        pFIN ();
     if (vmh) {
        ttyR (NULLCMD);
        pFIN ();