diff options
author | 2004-12-10 11:55:25 +0000 | |
---|---|---|
committer | 2004-12-10 11:55:25 +0000 | |
commit | 0adcc6f7b2fdfdb14c560ad967ef0e61db3e2fde (patch) | |
tree | 58ac759e6ad8a45c7896b175dad8b67a8033e58f | |
parent | 80a0c3cdd03118f349d77bc67730e6be0e53a41e (diff) |
fix
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | util/fusermount.c | 9 |
2 files changed, 12 insertions, 2 deletions
@@ -1,3 +1,8 @@ +2004-12-10 Miklos Szeredi <miklos@szeredi.hu> + + * When mounting on a subdirectory of / don't duplicate slashes at + the beggining of path (spotted by David Shaw) + 2004-12-09 Miklos Szeredi <miklos@szeredi.hu> * Fix bug causing garbage in mount options (spotted by David Shaw) diff --git a/util/fusermount.c b/util/fusermount.c index 77e808e..40df490 100644 --- a/util/fusermount.c +++ b/util/fusermount.c @@ -817,8 +817,13 @@ static char *resolve_path(const char *orig) dst = strdup(buf); else { dst = (char *) malloc(strlen(buf) + 1 + strlen(lastcomp) + 1); - if (dst) - sprintf(dst, "%s/%s", buf, lastcomp); + if (dst) { + unsigned buflen = strlen(buf); + if (buflen && buf[buflen-1] == '/') + sprintf(dst, "%s%s", buf, lastcomp); + else + sprintf(dst, "%s/%s", buf, lastcomp); + } } free(copy); if (dst == NULL) |