Renamed all standard sequences (e.g. cur->c) and made them globally changeable
[mmh] / uip / scan.c
index 69c2da9..478e4a6 100644 (file)
@@ -204,7 +204,7 @@ main(int argc, char **argv)
        */
 
        if (!msgs.size)
-               app_msgarg(&msgs, "all");
+               app_msgarg(&msgs, seq_all);
        if (!folder)
                folder = getcurfol();
        maildir = toabsdir(folder);
@@ -231,20 +231,23 @@ main(int argc, char **argv)
        context_save();  /* save the context file */
 
        /*
-       ** Get the sequence number for each sequence
-       ** specified by Unseen-Sequence
+       ** Get the sequence number for each `unseen' sequence
        */
-       if ((cp = context_find(usequence)) && *cp) {
+       if (!(cp = context_find(usequence))) {
+               cp = seq_unseen;  /* use default, if not set */
+       }
+       if (*cp) {
                char **ap, *dp;
 
                dp = getcpy(cp);
                ap = brkstring(dp, " ", "\n");
-               for (i = 0; ap && *ap; i++, ap++)
+               for (i = 0; ap && *ap; i++, ap++) {
                        seqnum[i] = seq_getnum(mp, *ap);
-
+               }
                num_unseen_seq = i;
-               if (dp)
+               if (dp) {
                        free(dp);
+               }
        }
 
        ontty = isatty(fileno(stdout));