Relayouted all switch statements: case aligns with switch.
[mmh] / uip / replsbr.c
index 1bdab9e..b63d013 100644 (file)
@@ -147,60 +147,60 @@ replout(FILE *inb, char *msg, char *drft, struct msgs *mp, int outputlinelen,
        for (state = FLD;;) {
                state = m_getfld(state, name, tmpbuf, SBUFSIZ, inb);
                switch (state) {
-                       case FLD:
-                       case FLDPLUS:
-                               /*
-                               ** if we're interested in this component,
-                               ** save a pointer to the component text,
-                               ** then start using our next free buffer
-                               ** as the component temp buffer (buffer
-                               ** switching saves an extra copy of the
-                               ** component text).
-                               */
-                               if ((cptr = wantcomp[CHASH(name)]))
-                                       do {
-                                               if (!mh_strcasecmp(name, cptr->c_name)) {
-                                                       char_read += msg_count;
-                                                       if (! cptr->c_text) {
-                                                               i = strlen(cptr->c_text = tmpbuf) - 1;
-                                                               if (tmpbuf[i] == '\n')
-                                                                       tmpbuf[i] = '\0';
-                                                               *--savecomp = cptr;
-                                                               tmpbuf = *nxtbuf++;
-                                                       } else {
-                                                               i = strlen(cp = cptr->c_text) - 1;
-                                                               if (cp[i] == '\n') {
-                                                                       if (cptr->c_type & CT_ADDR) {
-                                                                               cp[i] = '\0';
-                                                                               cp = add(",\n\t", cp);
-                                                                       } else {
-                                                                               cp = add("\t", cp);
-                                                                       }
+               case FLD:
+               case FLDPLUS:
+                       /*
+                       ** if we're interested in this component, save
+                       ** a pointer to the component text, then start
+                       ** using our next free buffer as the component
+                       ** temp buffer (buffer switching saves an extra
+                       ** copy of the component text).
+                       */
+                       if ((cptr = wantcomp[CHASH(name)]))
+                               do {
+                                       if (!mh_strcasecmp(name, cptr->c_name)) {
+                                               char_read += msg_count;
+                                               if (! cptr->c_text) {
+                                                       i = strlen(cptr->c_text = tmpbuf) - 1;
+                                                       if (tmpbuf[i] == '\n')
+                                                               tmpbuf[i] = '\0';
+                                                       *--savecomp = cptr;
+                                                       tmpbuf = *nxtbuf++;
+                                               } else {
+                                                       i = strlen(cp = cptr->c_text) - 1;
+                                                       if (cp[i] == '\n') {
+                                                               if (cptr->c_type & CT_ADDR) {
+                                                                       cp[i] = '\0';
+                                                                       cp = add(",\n\t", cp);
+                                                               } else {
+                                                                       cp = add("\t", cp);
                                                                }
-                                                               cptr->c_text = add(tmpbuf, cp);
-                                                       }
-                                                       while (state == FLDPLUS) {
-                                                               state = m_getfld(state, name, tmpbuf,
-                                                                                                 SBUFSIZ, inb);
-                                                               cptr->c_text = add(tmpbuf, cptr->c_text);
-                                                               char_read += msg_count;
                                                        }
-                                                       break;
+                                                       cptr->c_text = add(tmpbuf, cp);
                                                }
-                                       } while ((cptr = cptr->c_next));
+                                               while (state == FLDPLUS) {
+                                                       state = m_getfld(state, name, tmpbuf,
+                                                                                         SBUFSIZ, inb);
+                                                       cptr->c_text = add(tmpbuf, cptr->c_text);
+                                                       char_read += msg_count;
+                                               }
+                                               break;
+                                       }
+                               } while ((cptr = cptr->c_next));
 
-                               while (state == FLDPLUS)
-                                       state = m_getfld(state, name, tmpbuf, SBUFSIZ, inb);
-                               break;
+                       while (state == FLDPLUS)
+                               state = m_getfld(state, name, tmpbuf,
+                                               SBUFSIZ, inb);
+                       break;
 
-                       case LENERR:
-                       case FMTERR:
-                       case BODY:
-                       case FILEEOF:
-                               goto finished;
+               case LENERR:
+               case FMTERR:
+               case BODY:
+               case FILEEOF:
+                       goto finished;
 
-                       default:
-                               adios(NULL, "m_getfld() returned %d", state);
+               default:
+                       adios(NULL, "m_getfld() returned %d", state);
                }
        }
 
@@ -442,28 +442,27 @@ replfilter(FILE *in, FILE *out, char *filter)
        lseek(fileno(in), (off_t) 0, SEEK_SET);
 
        switch (pid = vfork()) {
-               case NOTOK:
-                       adios("fork", "unable to");
-
-               case OK:
-                       dup2(fileno(in), fileno(stdin));
-                       dup2(fileno(out), fileno(stdout));
-                       closefds(3);
-
-                       execlp(mhlproc, mhl, "-form", filter, "-noclear",
-                                       NULL);
-                       errstr = strerror(errno);
-                       write(2, "unable to exec ", 15);
-                       write(2, mhlproc, strlen(mhlproc));
-                       write(2, ": ", 2);
-                       write(2, errstr, strlen(errstr));
-                       write(2, "\n", 1);
-                       _exit(-1);
-
-               default:
-                       if (pidXwait(pid, mhl))
-                               done(1);
-                       fseek(out, 0L, SEEK_END);
-                       break;
+       case NOTOK:
+               adios("fork", "unable to");
+
+       case OK:
+               dup2(fileno(in), fileno(stdin));
+               dup2(fileno(out), fileno(stdout));
+               closefds(3);
+
+               execlp(mhlproc, mhl, "-form", filter, "-noclear", NULL);
+               errstr = strerror(errno);
+               write(2, "unable to exec ", 15);
+               write(2, mhlproc, strlen(mhlproc));
+               write(2, ": ", 2);
+               write(2, errstr, strlen(errstr));
+               write(2, "\n", 1);
+               _exit(-1);
+
+       default:
+               if (pidXwait(pid, mhl))
+                       done(1);
+               fseek(out, 0L, SEEK_END);
+               break;
        }
 }