From eb8531fe66396d088d3f8c5dc5342c9898406830 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Mon, 30 May 2011 17:47:53 +0200 Subject: [PATCH] bvfs: Handle windows drive when building path hierarchy --- bacula/src/cats/bvfs.c | 9 +++++++++ 1 file changed, 9 insertions(+) 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'; } -- 2.39.5