com_ls(): Always print the basename as the subject if -lv was given.
authorAndre Noll <maan@systemlinux.org>
Sat, 29 Dec 2007 20:44:28 +0000 (21:44 +0100)
committerAndre Noll <maan@systemlinux.org>
Sat, 29 Dec 2007 20:44:28 +0000 (21:44 +0100)
aft.c

diff --git a/aft.c b/aft.c
index 6481f3e..2b7a7af 100644 (file)
--- a/aft.c
+++ b/aft.c
@@ -886,13 +886,15 @@ static int print_list_item(struct ls_data *d, struct ls_options *opts,
        lyrics_lines = make_lyrics_lines(afsi);
        image_lines = make_image_lines(afsi);
        filename_lines = make_filename_lines(d->path, opts->flags);
-       if (opts->mode == LS_MODE_MBOX)
+       if (opts->mode == LS_MODE_MBOX) {
+               const char *bn = para_basename(d->path);
                para_printf(b,
                        "From foo@localhost %s\n"
                        "Received: from\nTo: bar\nFrom: a\n"
                        "Subject: %s\n\n",
                        last_played_time,
-                       d->path);
+                       bn? bn : "?");
+       }
        para_printf(b,
                "%s" /* filename stuff */
                "%s%s%s%s" /* score */