Relayouted all switch statements: case aligns with switch.
[mmh] / uip / sendsbr.c
index 1534402..42c2c21 100644 (file)
@@ -675,48 +675,48 @@ alert(char *file, int out)
                sleep(5);
 
        switch (child_id) {
-               case NOTOK:
-                       /* oops -- fork error */
-                       advise("fork", "unable to");
+       case NOTOK:
+               /* oops -- fork error */
+               advise("fork", "unable to");
 
-               case OK:
-                       /* child process -- send it */
-                       SIGNAL(SIGHUP, SIG_IGN);
-                       SIGNAL(SIGINT, SIG_IGN);
-                       SIGNAL(SIGQUIT, SIG_IGN);
-                       SIGNAL(SIGTERM, SIG_IGN);
-                       if (forwsw) {
-                               if ((in = open(file, O_RDONLY)) == NOTOK) {
-                                       admonish(file, "unable to re-open");
-                               } else {
-                                       lseek(out, (off_t) 0, SEEK_END);
-                                       strncpy(buf, "\nMessage not delivered to anyone.\n", sizeof(buf));
-                                       write(out, buf, strlen(buf));
-                                       strncpy(buf, "\n------- Unsent Draft\n\n", sizeof(buf));
-                                       write(out, buf, strlen(buf));
-                                       cpydgst(in, out, file, "temporary file");
-                                       close(in);
-                                       strncpy(buf, "\n------- End of Unsent Draft\n", sizeof(buf));
-                                       write(out, buf, strlen(buf));
-                                       if (rename(file, strncpy(buf, m_backup(file), sizeof(buf))) == NOTOK)
-                                               admonish(buf, "unable to rename %s to", file);
-                               }
+       case OK:
+               /* child process -- send it */
+               SIGNAL(SIGHUP, SIG_IGN);
+               SIGNAL(SIGINT, SIG_IGN);
+               SIGNAL(SIGQUIT, SIG_IGN);
+               SIGNAL(SIGTERM, SIG_IGN);
+               if (forwsw) {
+                       if ((in = open(file, O_RDONLY)) == NOTOK) {
+                               admonish(file, "unable to re-open");
+                       } else {
+                               lseek(out, (off_t) 0, SEEK_END);
+                               strncpy(buf, "\nMessage not delivered to anyone.\n", sizeof(buf));
+                               write(out, buf, strlen(buf));
+                               strncpy(buf, "\n------- Unsent Draft\n\n", sizeof(buf));
+                               write(out, buf, strlen(buf));
+                               cpydgst(in, out, file, "temporary file");
+                               close(in);
+                               strncpy(buf, "\n------- End of Unsent Draft\n", sizeof(buf));
+                               write(out, buf, strlen(buf));
+                               if (rename(file, strncpy(buf, m_backup(file), sizeof(buf))) == NOTOK)
+                                       admonish(buf, "unable to rename %s to", file);
                        }
-                       lseek(out, (off_t) 0, SEEK_SET);
-                       dup2(out, fileno(stdin));
-                       close(out);
-                       /* create subject for error notification */
-                       snprintf(buf, sizeof(buf), "send failed on %s",
-                                       forwsw ? "enclosed draft" : file);
-
-                       execlp(mailproc, mhbasename(mailproc),
-                                       getusername(), "-subject", buf, NULL);
-                       fprintf(stderr, "unable to exec ");
-                       perror(mailproc);
-                       _exit(-1);
-
-               default:  /* no waiting... */
-                       break;
+               }
+               lseek(out, (off_t) 0, SEEK_SET);
+               dup2(out, fileno(stdin));
+               close(out);
+               /* create subject for error notification */
+               snprintf(buf, sizeof(buf), "send failed on %s",
+                               forwsw ? "enclosed draft" : file);
+
+               execlp(mailproc, mhbasename(mailproc), getusername(),
+                               "-subject", buf, NULL);
+               fprintf(stderr, "unable to exec ");
+               perror(mailproc);
+               _exit(-1);
+
+       default:  /* no waiting... */
+               break;
        }
 }
 
@@ -760,34 +760,34 @@ anno(int fd, struct stat *st)
 
        child_id = debugsw ? NOTOK : fork();
        switch (child_id) {
-               case NOTOK:  /* oops */
-                       if (!debugsw)
-                               advise(NULL, "unable to fork, so doing annotations by hand...");
-                       if (cwd == NULL)
-                               cwd = getcpy(pwd());
+       case NOTOK:  /* oops */
+               if (!debugsw)
+                       advise(NULL, "unable to fork, so doing annotations by hand...");
+               if (cwd == NULL)
+                       cwd = getcpy(pwd());
 
-               case OK:
-                       /* block a few signals */
-                       sigemptyset(&set);
-                       sigaddset(&set, SIGHUP);
-                       sigaddset(&set, SIGINT);
-                       sigaddset(&set, SIGQUIT);
-                       sigaddset(&set, SIGTERM);
-                       SIGPROCMASK(SIG_BLOCK, &set, &oset);
-
-                       annoaux(fd);
-                       if (child_id == OK)
-                               _exit(0);
-
-                       /* reset the signal mask */
-                       SIGPROCMASK(SIG_SETMASK, &oset, &set);
-
-                       chdir(cwd);
-                       break;
+       case OK:
+               /* block a few signals */
+               sigemptyset(&set);
+               sigaddset(&set, SIGHUP);
+               sigaddset(&set, SIGINT);
+               sigaddset(&set, SIGQUIT);
+               sigaddset(&set, SIGTERM);
+               SIGPROCMASK(SIG_BLOCK, &set, &oset);
+
+               annoaux(fd);
+               if (child_id == OK)
+                       _exit(0);
+
+               /* reset the signal mask */
+               SIGPROCMASK(SIG_SETMASK, &oset, &set);
+
+               chdir(cwd);
+               break;
 
-               default:  /* no waiting... */
-                       close(fd);
-                       break;
+       default:  /* no waiting... */
+               close(fd);
+               break;
        }
 }