summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernd Schubert <bernd.schubert@fastmail.fm>2010-05-24 16:07:34 +0200
committerBernd Schubert <bernd.schubert@fastmail.fm>2010-05-24 16:07:34 +0200
commit3cd37a2e7e7ba8c64a93e4cf889496627df2e02b (patch)
tree1756e71278cc7b96b3fa4b6fe486269a2c1fbacf
parentf2a2ddc21c812e86170b848cae18d3ced839e2aa (diff)
downloadunionfs-fuse-3cd37a2e7e7ba8c64a93e4cf889496627df2e02b.tar.gz
build_path: Make sure we really have slashes between path elements
-rw-r--r--src/string.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/string.c b/src/string.c
index 794f368..a05bb69 100644
--- a/src/string.c
+++ b/src/string.c
@@ -99,6 +99,11 @@ int build_path(char *path, int max_len, char *callfunc, ...) {
// eventually we walk over the slashes of the
// next string
while (*str == '/') str++;
+ } else if (*str != '/') {
+ // neither path ends with a slash, nor str
+ // starts with a slash, prevent a wrong path
+ strcat(path, "/");
+ len++;
}
}