diff options
author | Bernd Schubert <bernd.schubert@fastmail.fm> | 2010-05-24 16:07:34 +0200 |
---|---|---|
committer | Bernd Schubert <bernd.schubert@fastmail.fm> | 2010-05-24 16:07:34 +0200 |
commit | 3cd37a2e7e7ba8c64a93e4cf889496627df2e02b (patch) | |
tree | 1756e71278cc7b96b3fa4b6fe486269a2c1fbacf /src | |
parent | f2a2ddc21c812e86170b848cae18d3ced839e2aa (diff) | |
download | unionfs-fuse-3cd37a2e7e7ba8c64a93e4cf889496627df2e02b.tar.gz |
build_path: Make sure we really have slashes between path elements
Diffstat (limited to 'src')
-rw-r--r-- | src/string.c | 5 |
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++; } } |