summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2011-01-11 13:55:23 +0000
committerRichard W.M. Jones <rjones@redhat.com>2011-03-08 14:50:57 +0000
commitbca76363ebac309df2aaeb57f9277e17817f0a52 (patch)
treea7f1effc65b675f43b7432766878998fc40c2b48
parent3b4ff15f15f323f6dcafef6a2ee59d6b527d749f (diff)
downloadlibguestfs-bca76363ebac309df2aaeb57f9277e17817f0a52.tar.gz
libguestfs-bca76363ebac309df2aaeb57f9277e17817f0a52.tar.xz
libguestfs-bca76363ebac309df2aaeb57f9277e17817f0a52.zip
df: Skip final '/' character when calculating basename.
Previously it was including the final '/' character when calculating the basename for the -a option eg: Filesystem Size Used Available Use% /Ubuntu1010x64:/dev/sda1 9.4G 2.3G 6.6G 25% With this patch the '/' is not printed. (cherry picked from commit e5220b26f51d5912371424ab6dfbdb46ce6aa170)
-rw-r--r--df/main.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/df/main.c b/df/main.c
index 55e5eaa8..7ac5a6c1 100644
--- a/df/main.c
+++ b/df/main.c
@@ -281,6 +281,8 @@ main (int argc, char *argv[])
name = strrchr (drvs->a.filename, '/');
if (name == NULL)
name = drvs->a.filename;
+ else
+ name++; /* skip '/' character */
break;
case drv_d:
name = drvs->d.guest;