]> diplodocus.org Git - nmh/blobdiff - uip/show.c
Alter HasSuffixC()'s char * to be const.
[nmh] / uip / show.c
index f89107855c0214bc766f1cc4c64312c9fc055c54..25ed7573fb5e3fbf38a7e855a2098e246262527b 100644 (file)
     /*                         \
      * switches for mhlproc    \
      */                                \
-    X("concat", -6, CONCATSW) \
-    X("noconcat", -8, NCONCATSW) \
+    X("concat", 0, CONCATSW) \
+    X("noconcat", 0, NCONCATSW) \
+    /*                         \
+     * switches for mhshow     \
+     */                                \
+    X("part number", 0, PARTSW) \
+    X("type content", 0, TYPESW) \
+    X("prefer content", 0, PREFERSW) \
+    X("markform file", 0, MARKFORMSW) \
+    X("rcache policy", 0, RCACHESW) \
+    X("wcache policy", 0, WCACHESW) \
 
 #define X(sw, minchars, id) id,
 DEFINE_SWITCH_ENUM(SHOW);
@@ -141,6 +150,12 @@ usage:
                case LENSW:
                case WIDTHSW:
                case FMTPROCSW:
+               case PARTSW:
+               case TYPESW:
+               case PREFERSW:
+               case MARKFORMSW:
+               case RCACHESW:
+               case WCACHESW:
                    app_msgarg(&vec, --cp);
                    if (!(cp = *argp++) || *cp == '-')
                        adios (NULL, "missing argument to %s", argp[-2]);
@@ -177,8 +192,7 @@ usage:
        } else {
            if (mode != SHOW)
                goto usage;
-           else
-               app_msgarg(&msgs, cp);
+            app_msgarg(&msgs, cp);
        }
     }
 
@@ -244,7 +258,7 @@ usage:
 
     for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++)
        if (is_selected(mp, msgnum))
-           app_msgarg(&vec, getcpy (m_name (msgnum)));
+           app_msgarg(&vec, mh_xstrdup(m_name (msgnum)));
 
     seq_setcur (mp, mp->hghsel);       /* update current message  */
     seq_save (mp);                     /* synchronize sequences   */
@@ -432,7 +446,7 @@ invalid:
                    if (*dp) {
                        if ((result = !uprf (dp, "charset")))
                            goto out;
-                       dp += sizeof("charset") - 1;
+                       dp += LEN("charset");
                        while (isspace ((unsigned char) *dp))
                            dp++;
                        if (*dp++ != '=')