- unsigned long size;
- char *cp, buffer[BUFSIZ];
- CI ci = &ct->c_ctinfo;
-
- printf (toplevel > 0 ? LSTFMT2a : toplevel < 0 ? "part " : " ",
- atoi (r1bindex (empty (ct->c_file), '/')));
- snprintf (buffer, sizeof(buffer), "%s/%s", empty (ci->ci_type),
- empty (ci->ci_subtype));
- printf (LSTFMT2b, empty (ct->c_partno), buffer);
-
- if (ct->c_cesizefnx && realsize)
- size = (*ct->c_cesizefnx) (ct);
- else
- size = ct->c_end - ct->c_begin;
-
- /* find correct scale for size (Kilo/Mega/Giga/Tera) */
- for (cp = " KMGT"; size > 9999; size >>= 10)
- if (!*++cp)
- break;
-
- /* print size of this body part */
- switch (*cp) {
- case ' ':
- if (size > 0 || ct->c_encoding != CE_EXTERNAL)
- printf (LSTFMT2c1, size);
- else
- printf (LSTFMT2c4);
- break;
-
- default:
- printf (LSTFMT2c2, size, *cp);
- break;
-
- case '\0':
- printf (LSTFMT2c3);
- }
-
- /* print Content-Description */
- if (ct->c_descr) {
- char *dp;
-
- dp = trimcpy (cp = add (ct->c_descr, NULL));
- free (cp);
- printf (LSTFMT2d1, dp);
- free (dp);
- }
-
- printf ("\n");
-
- /*
- * If verbose, print any RFC-822 comments in the
- * Content-Type line.
- */
- if (verbose && ci->ci_comment) {
- char *dp;
-
- dp = trimcpy (cp = add (ci->ci_comment, NULL));
- free (cp);
- snprintf (buffer, sizeof(buffer), "(%s)", dp);
- free (dp);
- printf (LSTFMT2d2, buffer);
- }
-
- if (debug)
- list_debug (ct);
-
- return OK;
+ unsigned long size;
+ char *cp, buffer[BUFSIZ];
+ CI ci = &ct->c_ctinfo;
+
+ printf(toplevel > 0 ? LSTFMT2a : toplevel < 0 ? "part " : " ",
+ atoi(mhbasename(empty(ct->c_file))));
+ snprintf(buffer, sizeof(buffer), "%s/%s", empty(ci->ci_type),
+ empty(ci->ci_subtype));
+ printf(LSTFMT2b, empty(ct->c_partno), buffer);
+
+ if (ct->c_cesizefnx && realsize)
+ size = (*ct->c_cesizefnx) (ct);
+ else
+ size = ct->c_end - ct->c_begin;
+
+ /* find correct scale for size (Kilo/Mega/Giga/Tera) */
+ for (cp = " KMGT"; size > 9999; size >>= 10)
+ if (!*++cp)
+ break;
+
+ /* print size of this body part */
+ switch (*cp) {
+ case ' ':
+ if (size > 0 || ct->c_encoding != CE_EXTERNAL)
+ printf(LSTFMT2c1, size);
+ else
+ printf(LSTFMT2c4);
+ break;
+
+ default:
+ printf(LSTFMT2c2, size, *cp);
+ break;
+
+ case '\0':
+ printf(LSTFMT2c3);
+ }
+
+ /* print Content-Description */
+ if (ct->c_descr) {
+ char *dp;
+
+ dp = trimcpy(cp = add(ct->c_descr, NULL));
+ free(cp);
+ printf(LSTFMT2d1, dp);
+ free(dp);
+ }
+
+ printf("\n");
+
+ /*
+ ** If verbose, print any RFC-822 comments in the
+ ** Content-Type line.
+ */
+ if (verbose && ci->ci_comment) {
+ char *dp;
+
+ dp = trimcpy(cp = add(ci->ci_comment, NULL));
+ free(cp);
+ snprintf(buffer, sizeof(buffer), "(%s)", dp);
+ free(dp);
+ printf(LSTFMT2d2, buffer);
+ }
+
+ if (debug)
+ list_debug(ct);
+
+ return OK;