]> diplodocus.org Git - nmh/blobdiff - uip/mhlistsbr.c
Refined commit ed3214f1518b36c8b96a1a17be4af0a708ea25e3 to only
[nmh] / uip / mhlistsbr.c
index fe3d069627036d9df32857879cb7cb3932a2bbb1..9380c3d72655c67e0dc31afb326bd708ad13aac2 100644 (file)
@@ -44,14 +44,14 @@ static int list_encoding (CT);
 /*
  * various formats for -list option
  */
-#define        LSTFMT1         "%4s %-5s %-24s %5s %-36s\n"
+#define        LSTFMT1         "%4s %-5s %-24s %5s %s\n"
 #define        LSTFMT2a        "%4d "
 #define        LSTFMT2b        "%-5s %-24.24s "
 #define        LSTFMT2c1       "%5lu"
 #define        LSTFMT2c2       "%4lu%c"
 #define        LSTFMT2c3       "huge "
 #define        LSTFMT2c4       "     "
-#define        LSTFMT2d1       " %-36.36s"
+#define        LSTFMT2d1       " %.36s"
 #define        LSTFMT2d2       "\t     %-65.65s\n"
 
 
@@ -106,40 +106,32 @@ list_switch (CT ct, int toplevel, int realsize, int verbose, int debug)
     switch (ct->c_type) {
        case CT_MULTIPART:
            return list_multi (ct, toplevel, realsize, verbose, debug);
-           break;
 
        case CT_MESSAGE:
            switch (ct->c_subtype) {
                case MESSAGE_PARTIAL:
                    return list_partial (ct, toplevel, realsize, verbose, debug);
-                   break;
 
                case MESSAGE_EXTERNAL:
                    return list_external (ct, toplevel, realsize, verbose, debug);
-                   break;
 
                case MESSAGE_RFC822:
                default:
                    return list_content (ct, toplevel, realsize, verbose, debug);
-                   break;
            }
-           break;
 
        case CT_TEXT:
        case CT_AUDIO:
        case CT_IMAGE:
        case CT_VIDEO:
            return list_content (ct, toplevel, realsize, verbose, debug);
-           break;
 
        case CT_APPLICATION:
            return list_application (ct, toplevel, realsize, verbose, debug);
-           break;
 
        default:
            /* list_debug (ct); */
            adios (NULL, "unknown content type %d", ct->c_type);
-           break;
     }
 
     return 0;  /* NOT REACHED */
@@ -159,8 +151,11 @@ list_content (CT ct, int toplevel, int realsize, int verbose, int debug)
     char *cp, buffer[BUFSIZ];
     CI ci = &ct->c_ctinfo;
 
-    printf (toplevel > 0 ? LSTFMT2a : toplevel < 0 ? "part " : "     ",
-           atoi (r1bindex (empty (ct->c_file), '/')));
+    if (toplevel > 0)
+       printf (LSTFMT2a, atoi (r1bindex (empty (ct->c_file), '/')));
+    else
+       printf(toplevel < 0 ? "part " : "     ");
+
     snprintf (buffer, sizeof(buffer), "%s/%s", empty (ci->ci_type),
                empty (ci->ci_subtype));
     printf (LSTFMT2b, empty (ct->c_partno), buffer);