diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2012-10-11 13:18:46 +0000 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2012-10-11 13:18:46 +0000 |
commit | f4a2aecd5ff4904994d75ad92b50a834d40eef17 (patch) | |
tree | 0867ee22e4638fff2b1d85b72cb05569b01ee7a4 /fish | |
parent | c34dcf184ef4eaa35634d1696e0c68d21b811170 (diff) | |
download | libguestfs-f4a2aecd5ff4904994d75ad92b50a834d40eef17.tar.gz libguestfs-f4a2aecd5ff4904994d75ad92b50a834d40eef17.tar.xz libguestfs-f4a2aecd5ff4904994d75ad92b50a834d40eef17.zip |
fish: inspect: Canonicalize paths for printing (RHBZ#859876).
Diffstat (limited to 'fish')
-rw-r--r-- | fish/inspect.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/fish/inspect.c b/fish/inspect.c index 3f611117..552c2199 100644 --- a/fish/inspect.c +++ b/fish/inspect.c @@ -179,7 +179,7 @@ void print_inspect_prompt (void) { size_t i; - char *name; + char *name, *dev; char **mountpoints; name = guestfs_inspect_get_product_name (g, root); @@ -195,8 +195,16 @@ print_inspect_prompt (void) qsort (mountpoints, count_strings (mountpoints) / 2, 2 * sizeof (char *), compare_keys); - for (i = 0; mountpoints[i] != NULL; i += 2) - printf (_("%s mounted on %s\n"), mountpoints[i+1], mountpoints[i]); + for (i = 0; mountpoints[i] != NULL; i += 2) { + /* Try to make the device name canonical for printing, but don't + * worry if this fails. + */ + dev = guestfs_canonical_device_name (g, mountpoints[i+1]); + if (!dev) + dev = mountpoints[i+1]; + + printf (_("%s mounted on %s\n"), dev, mountpoints[i]); + } free_strings (mountpoints); } |