]> diplodocus.org Git - nmh/blobdiff - uip/scan.c
sbr/vector.c: Zero the growth with memset(3), not loop.
[nmh] / uip / scan.c
index 8ba503670ba819e58c6e70fe45fad4fcc4906cbf..4e9f6b9216851a0189bce06093cd098b364a9495 100644 (file)
@@ -1,6 +1,4 @@
-
-/*
- * scan.c -- display a one-line "scan" listing of folder or messages
+/* scan.c -- display a one-line "scan" listing of folder or messages
  *
  * This code is Copyright (c) 2002, by the authors of nmh.  See the
  * COPYRIGHT file in the root directory of the nmh distribution for
  *
  * This code is Copyright (c) 2002, by the authors of nmh.  See the
  * COPYRIGHT file in the root directory of the nmh distribution for
@@ -41,7 +39,7 @@ int
 main (int argc, char **argv)
 {
     int clearflag = 0, hdrflag = 0, ontty;
 main (int argc, char **argv)
 {
     int clearflag = 0, hdrflag = 0, ontty;
-    int width = 0, revflag = 0;
+    int width = -1, revflag = 0;
     int i, state, msgnum;
     ivector_t seqnum = ivector_create (0);
     int unseen, num_unseen_seq = 0;
     int i, state, msgnum;
     ivector_t seqnum = ivector_create (0);
     int unseen, num_unseen_seq = 0;
@@ -54,7 +52,7 @@ main (int argc, char **argv)
 
     if (nmh_init(argv[0], 1)) { return 1; }
 
 
     if (nmh_init(argv[0], 1)) { return 1; }
 
-    mts_init (invo_name);
+    mts_init ();
     arguments = getarguments (invo_name, argc, argv, 1);
     argp = arguments;
 
     arguments = getarguments (invo_name, argc, argv, 1);
     argp = arguments;
 
@@ -216,14 +214,13 @@ main (int argc, char **argv)
     if ((cp = context_find (usequence)) && *cp) {
        char **ap, *dp;
 
     if ((cp = context_find (usequence)) && *cp) {
        char **ap, *dp;
 
-       dp = getcpy(cp);
+       dp = mh_xstrdup(cp);
        ap = brkstring (dp, " ", "\n");
        for (i = 0; ap && *ap; i++, ap++)
            ivector_push_back (seqnum, seq_getnum (mp, *ap));
 
        num_unseen_seq = i;
        ap = brkstring (dp, " ", "\n");
        for (i = 0; ap && *ap; i++, ap++)
            ivector_push_back (seqnum, seq_getnum (mp, *ap));
 
        num_unseen_seq = i;
-       if (dp)
-           free(dp);
+        mh_xfree(dp);
     }
 
     ontty = isatty (fileno (stdout));
     }
 
     ontty = isatty (fileno (stdout));
@@ -267,7 +264,7 @@ main (int argc, char **argv)
                    adios (NULL, "scan() botch (%d)", state);
 
                case SCNEOF: 
                    adios (NULL, "scan() botch (%d)", state);
 
                case SCNEOF: 
-                   advise (NULL, "message %d: empty", msgnum);
+                   inform("message %d: empty", msgnum);
                    break;
            }
            charstring_free (scanl);
                    break;
            }
            charstring_free (scanl);