Fixed nsIOService::ResolveRelativePath problem when basePath ends in '/', b=97682, r=andreas.otte@primus-online.de, sr=dougt

This commit is contained in:
cmanske%netscape.com 2001-09-26 19:34:11 +00:00
Родитель b3d1f5a381
Коммит 8cc36ba7b9
1 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

@ -889,10 +889,12 @@ nsIOService::ResolveRelativePath(const char *relativePath, const char* basePath,
// delimiter found
if (name.Equals("..")) {
// pop path
PRInt32 pos = path.RFind("/");
// If we already have the delim at end, then
// skip over that when searching for next one to the left
PRInt32 offset = path.Length() - (needsDelim ? 1 : 2);
PRInt32 pos = path.RFind("/", PR_FALSE, offset);
if (pos > 0) {
path.Truncate(pos + 1);
path += name;
}
else {
return NS_ERROR_MALFORMED_URI;