Remove dead code: FLDEOF and BODYEOF are never set
[mmh] / sbr / seq_read.c
index 3a9633e..b932cad 100644 (file)
@@ -7,6 +7,7 @@
 ** complete copyright information.
 */
 
+#include <sysexits.h>
 #include <h/mh.h>
 #include <h/utils.h>
 
@@ -78,7 +79,6 @@ seq_public(struct msgs *mp)
                                fp)) {
                case FLD:
                case FLDPLUS:
-               case FLDEOF:
                        if (state == FLDPLUS) {
                                cp = getcpy(field);
                                while (state == FLDPLUS) {
@@ -91,13 +91,10 @@ seq_public(struct msgs *mp)
                        } else {
                                seq_init(mp, getcpy(name), trimcpy(field));
                        }
-                       if (state == FLDEOF)
-                               break;
                        continue;
 
                case BODY:
-               case BODYEOF:
-                       adios(NULL, "no blank lines are permitted in %s",
+                       adios(EX_CONFIG, NULL, "no blank lines are permitted in %s",
                                        seqfile);
                        /* fall */
 
@@ -105,7 +102,7 @@ seq_public(struct msgs *mp)
                        break;
 
                default:
-                       adios(NULL, "%s is poorly formatted", seqfile);
+                       adios(EX_CONFIG, NULL, "%s is poorly formatted", seqfile);
                }
                break;  /* break from for loop */
        }
@@ -132,11 +129,10 @@ seq_private(struct msgs *mp)
        plen = strlen(mp->foldpath) + 1;
 
        for (np = m_defs; np; np = np->n_next) {
-               if (strncmp(np->n_name, "atr-", alen)==0
-                               && (j = strlen(np->n_name) - plen) > alen
-                               && *(np->n_name + j) == '-'
-                               && strcmp(mp->foldpath, np->n_name + j + 1)
-                               == 0) {
+               if (strncmp(np->n_name, "atr-", alen)==0 &&
+                               (j = strlen(np->n_name) - plen) > alen &&
+                               *(np->n_name + j) == '-' &&
+                               strcmp(mp->foldpath, np->n_name + j + 1)==0) {
                        cp = getcpy(np->n_name + alen);
                        *(cp + j - alen) = '\0';
                        if ((i = seq_init(mp, cp, getcpy(np->n_field))) != -1)
@@ -159,14 +155,15 @@ seq_private(struct msgs *mp)
 static int
 seq_init(struct msgs *mp, char *name, char *field)
 {
-       int i, j, k, is_current;
+       unsigned int i;
+       int j, k, is_current;
        char *cp, **ap;
 
        /*
        ** Check if this is the cur sequence,
        ** so we can do some special things.
        */
-       is_current = !strcmp(seq_cur, name);
+       is_current = (strcmp(seq_cur, name)==0);
 
        /*
        ** Search for this sequence name to see if we've seen
@@ -175,7 +172,7 @@ seq_init(struct msgs *mp, char *name, char *field)
        ** mesages in this folder.
        */
        for (i = 0; mp->msgattrs[i]; i++) {
-               if (!strcmp(mp->msgattrs[i], name)) {
+               if (strcmp(mp->msgattrs[i], name)==0) {
                        for (j = mp->lowmsg; j <= mp->hghmsg; j++)
                                clear_sequence(mp, i, j);
                        break;