From: Eric Bollengier Date: Mon, 30 May 2011 15:47:53 +0000 (+0200) Subject: bvfs: Handle windows drive when building path hierarchy X-Git-Tag: Release-7.0.0~479 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=eb8531fe66396d088d3f8c5dc5342c9898406830;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'; }