- if (!image_name)
- return make_message("%u", afsi->image_id);
- return make_message("%u (%s)", afsi->image_id, image_name);
+ return make_message("image_id: %u\nimage_name: %s\n",
+ afsi->image_id, image_name? image_name : "(none)");
+}
+
+static char *make_filename_lines(const char *path, unsigned flags)
+{
+ char *basename, *dirname;
+ char *ret;
+
+ if (!(flags & LS_FLAG_FULL_PATH))
+ return make_message("%s: %s\n%s:\n", "basename", path,
+ "dir");
+ basename = para_basename(path),
+ dirname = para_dirname(path);
+ ret = make_message("%s: %s\n%s: %s\n%s: %s\n", "path", path,
+ "dir", dirname, "basename", basename);
+ free(basename);
+ free(dirname);
+ return ret;