This commit is contained in:
Miklos Szeredi 2004-12-10 11:55:04 +00:00
parent 566611d3e3
commit 16d7c0a74e
2 changed files with 12 additions and 2 deletions

View File

@ -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)

View File

@ -780,8 +780,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)