From: Eric Bollengier Date: Mon, 30 May 2011 15:47:53 +0000 (+0200) Subject: bvfs: Handle windows drive when building path hierarchy X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=256036abde3b6d832e710487d2145b61460cf039;p=bacula%2Fbacula bvfs: Handle windows drive when building path hierarchy --- diff --git a/bacula/src/cats/bvfs.c b/bacula/src/cats/bvfs.c index 1cfcc93485..35e59c851d 100644 --- a/bacula/src/cats/bvfs.c +++ b/bacula/src/cats/bvfs.c @@ -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'; }