X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=df%2Fmain.c;h=cbc6d0659f8af1c41d408fe51ea4944a18abd3d7;hb=c018c39cc9dfe2d7bf923a87d5c71e96654499ba;hp=9565464bff5d67685affe4fb869c281dab2eef01;hpb=18374b5b7d3154e0b8b8a07e3590f6eee762b58e;p=libguestfs.git diff --git a/df/main.c b/df/main.c index 9565464..cbc6d06 100644 --- a/df/main.c +++ b/df/main.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #ifdef HAVE_LIBVIRT @@ -279,6 +280,10 @@ main (int argc, char *argv[]) switch (drvs->type) { case drv_a: name = strrchr (drvs->a.filename, '/'); + if (name == NULL) + name = drvs->a.filename; + else + name++; /* skip '/' character */ break; case drv_d: name = drvs->d.guest;