зеркало из https://github.com/mozilla/pjs.git
Fixed nsIOService::ResolveRelativePath problem when basePath ends in '/', b=97682, r=andreas.otte@primus-online.de, sr=dougt
This commit is contained in:
Родитель
b3d1f5a381
Коммит
8cc36ba7b9
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче