Relayouted all switch statements: case aligns with switch.
[mmh] / uip / mhshowsbr.c
index 7f3ef70..0136ca3 100644 (file)
@@ -251,44 +251,42 @@ static int
 show_switch(CT ct, int serial, int alternate)
 {
        switch (ct->c_type) {
-               case CT_MULTIPART:
-                       return show_multi(ct, serial, alternate);
-                       break;
+       case CT_MULTIPART:
+               return show_multi(ct, serial, alternate);
+               break;
 
-               case CT_MESSAGE:
-                       switch (ct->c_subtype) {
-                               case MESSAGE_PARTIAL:
-                                       return show_partial(ct, serial,
-                                                       alternate);
-                                       break;
+       case CT_MESSAGE:
+               switch (ct->c_subtype) {
+                       case MESSAGE_PARTIAL:
+                               return show_partial(ct, serial, alternate);
+                               break;
 
-                               case MESSAGE_EXTERNAL:
-                                       return show_external(ct, serial,
-                                                       alternate);
-                                       break;
+                       case MESSAGE_EXTERNAL:
+                               return show_external(ct, serial, alternate);
+                               break;
 
-                               case MESSAGE_RFC822:
-                               default:
-                                       return show_message_rfc822(ct, serial,
-                                                       alternate);
-                                       break;
-                       }
-                       break;
+                       case MESSAGE_RFC822:
+                       default:
+                               return show_message_rfc822(ct, serial,
+                                               alternate);
+                               break;
+               }
+               break;
 
-               case CT_TEXT:
-                       return show_text(ct, serial, alternate);
-                       break;
+       case CT_TEXT:
+               return show_text(ct, serial, alternate);
+               break;
 
-               case CT_AUDIO:
-               case CT_IMAGE:
-               case CT_VIDEO:
-               case CT_APPLICATION:
-                       return show_content(ct, serial, alternate);
-                       break;
+       case CT_AUDIO:
+       case CT_IMAGE:
+       case CT_VIDEO:
+       case CT_APPLICATION:
+               return show_content(ct, serial, alternate);
+               break;
 
-               default:
-                       adios(NULL, "unknown content type %d", ct->c_type);
-                       break;
+       default:
+               adios(NULL, "unknown content type %d", ct->c_type);
+               break;
        }
 
        return 0;  /* NOT REACHED */
@@ -377,7 +375,7 @@ show_content_aux(CT ct, int serial, int alternate, char *cp, char *cracked)
                        switch (*++cp) {
                        case 'a':
                                /* insert parameters from Content-Type field */
-                       {
+                               {
                                char **ap, **ep;
                                char *s = "";
 
@@ -390,8 +388,8 @@ show_content_aux(CT ct, int serial, int alternate, char *cp, char *cracked)
                                        buflen -= len;
                                        s = " ";
                                }
-                       }
-                       break;
+                               }
+                               break;
 
                        case 'd':
                                /* insert content description */
@@ -607,35 +605,35 @@ show_content_aux2(CT ct, int serial, int alternate, char *cracked,
        for (i = 0; (child_id = vfork()) == NOTOK && i < 5; i++)
                sleep(5);
        switch (child_id) {
-               case NOTOK:
-                       advise("fork", "unable to");
-                       (*ct->c_ceclosefnx) (ct);
-                       return NOTOK;
+       case NOTOK:
+               advise("fork", "unable to");
+               (*ct->c_ceclosefnx) (ct);
+               return NOTOK;
 
-               case OK:
-                       if (cracked)
-                               chdir(cracked);
-                       if (!xstdin)
-                               dup2(fd, 0);
-                       close(fd);
-                       execvp("/bin/sh", vec);
-                       fprintf(stderr, "unable to exec ");
-                       perror("/bin/sh");
-                       _exit(-1);
-                       /* NOTREACHED */
-
-               default:
-                       if (!serial) {
-                               ct->c_pid = child_id;
-                               if (xtty)
-                                       xpid = child_id;
-                       } else {
-                               pidcheck(pidXwait(child_id, NULL));
-                       }
+       case OK:
+               if (cracked)
+                       chdir(cracked);
+               if (!xstdin)
+                       dup2(fd, 0);
+               close(fd);
+               execvp("/bin/sh", vec);
+               fprintf(stderr, "unable to exec ");
+               perror("/bin/sh");
+               _exit(-1);
+               /* NOTREACHED */
 
-                       if (fd != NOTOK)
-                               (*ct->c_ceclosefnx) (ct);
-                       return (alternate ? DONE : OK);
+       default:
+               if (!serial) {
+                       ct->c_pid = child_id;
+                       if (xtty)
+                               xpid = child_id;
+               } else {
+                       pidcheck(pidXwait(child_id, NULL));
+               }
+
+               if (fd != NOTOK)
+                       (*ct->c_ceclosefnx) (ct);
+               return (alternate ? DONE : OK);
        }
 }
 
@@ -770,25 +768,25 @@ show_multi_internal(CT ct, int serial, int alternate)
 
                        inneresult = show_switch(p, nowserial, nowalternate);
                        switch (inneresult) {
-                               case NOTOK:
-                                       if (alternate && !alternating) {
-                                               result = NOTOK;
-                                               goto out;
-                                       }
-                                       continue;
-
-                               case OK:
-                               case DONE:
-                                       if (alternating) {
-                                               result = DONE;
-                                               break;
-                                       }
-                                       if (alternate) {
-                                               alternate = nowalternate = 0;
-                                               if (result == NOTOK)
-                                                       result = inneresult;
-                                       }
-                                       continue;
+                       case NOTOK:
+                               if (alternate && !alternating) {
+                                       result = NOTOK;
+                                       goto out;
+                               }
+                               continue;
+
+                       case OK:
+                       case DONE:
+                               if (alternating) {
+                                       result = DONE;
+                                       break;
+                               }
+                               if (alternate) {
+                                       alternate = nowalternate = 0;
+                                       if (result == NOTOK)
+                                               result = inneresult;
+                               }
+                               continue;
                        }
                        break;
                }
@@ -909,7 +907,7 @@ show_multi_aux(CT ct, int serial, int alternate, char *cp)
                        switch (*++cp) {
                        case 'a':
                                /* insert parameters from Content-Type field */
-                       {
+                               {
                                char **ap, **ep;
                                char *s = "";
 
@@ -922,8 +920,8 @@ show_multi_aux(CT ct, int serial, int alternate, char *cp)
                                        buflen -= len;
                                        s = " ";
                                }
-                       }
-                       break;
+                               }
+                               break;
 
                        case 'd':
                                /* insert content description */