Always write image_name and lyrics_name status output.
authorAndre Noll <maan@systemlinux.org>
Thu, 1 Nov 2007 18:06:39 +0000 (19:06 +0100)
committerAndre Noll <maan@systemlinux.org>
Thu, 1 Nov 2007 18:06:39 +0000 (19:06 +0100)
If there is no image_name, print "(none)". Same with
lyrics.

aft.c

diff --git a/aft.c b/aft.c
index 95de880..62db6e7 100644 (file)
--- a/aft.c
+++ b/aft.c
@@ -816,20 +816,16 @@ static char *make_lyrics_lines(struct afs_info *afsi)
        char *lyrics_name;
 
        lyr_get_name_by_id(afsi->lyrics_id, &lyrics_name);
-       if (!lyrics_name)
-               return make_message("lyrics_id: %u\n", afsi->lyrics_id);
        return make_message("lyrics_id: %u\nlyrics_name: %s\n",
-               afsi->lyrics_id, lyrics_name);
+               afsi->lyrics_id, lyrics_name? lyrics_name : "(none)");
 }
 
 static char *make_image_lines(struct afs_info *afsi)
 {
        char *image_name;
        img_get_name_by_id(afsi->image_id, &image_name);
-       if (!image_name)
-               return make_message("image_id: %u\n", afsi->image_id);
        return make_message("image_id: %u\nimage_name: %s\n",
-               afsi->image_id, image_name);
+               afsi->image_id, image_name? image_name : "(none)");
 }
 
 static int print_list_item(struct ls_data *d, struct ls_options *opts,