Version 1.9.10.
[libguestfs.git] / df / main.c
index 9565464..3421d90 100644 (file)
--- a/df/main.c
+++ b/df/main.c
@@ -24,6 +24,7 @@
 #include <inttypes.h>
 #include <unistd.h>
 #include <getopt.h>
+#include <locale.h>
 #include <assert.h>
 
 #ifdef HAVE_LIBVIRT
@@ -41,6 +42,7 @@
 guestfs_h *g;
 
 int read_only = 1;
+int live = 0;
 int verbose = 0;
 int keys_from_stdin = 0;
 int echo_keys = 0;
@@ -238,6 +240,7 @@ main (int argc, char *argv[])
    */
   assert (read_only == 1);
   assert (inspector == 0);
+  assert (live == 0);
 
   /* Must be no extra arguments on the command line. */
   if (optind != argc)
@@ -279,6 +282,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;