]> git.sur5r.net Git - bacula/bacula/commitdiff
bvfs: Handle windows drive when building path hierarchy
authorEric Bollengier <eric@eb.homelinux.org>
Mon, 30 May 2011 15:47:53 +0000 (17:47 +0200)
committerKern Sibbald <kern@sibbald.com>
Sat, 20 Apr 2013 12:50:11 +0000 (14:50 +0200)
bacula/src/cats/bvfs.c

index 1cfcc934854c1468862a03da62b621089c8c6bf0..35e59c851d869e50c6d637cddc81c70b872e78b8 100644 (file)
@@ -199,6 +199,15 @@ char *bvfs_parent_dir(char *path)
    char *p = path;
    int len = strlen(path) - 1;
 
+   /* windows directory / */
+   if (len == 2 && B_ISALPHA(path[0]) 
+                && path[1] == ':' 
+                && path[2] == '/')
+   {
+      len = 0;
+      path[0] = '\0';
+   }
+
    if (len >= 0 && path[len] == '/') {      /* if directory, skip last / */
       path[len] = '\0';
    }