[not part of build] Fix for bug 127085. Unescape file paths before trying to use them. r=sdagley, sr=beard.

This commit is contained in:
bnesse%netscape.com 2002-02-22 20:13:31 +00:00
Родитель e0b5d4da68
Коммит ddb95818d5
1 изменённых файлов: 6 добавлений и 2 удалений

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

@ -1317,8 +1317,12 @@ Boolean MRJContext::loadApplet()
}
cfref<CFStringRef> pathRef = CFStringCreateWithCString(NULL, path, kCFStringEncodingUTF8);
delete[] path;
if (pathRef)
documentBase = CFURLCreateWithFileSystemPath(NULL, pathRef, kCFURLHFSPathStyle, false);
if (pathRef) {
// unescape the path in case there are spaces in it
cfref<CFStringRef> unescPathRef = CFURLCreateStringByReplacingPercentEscapes(NULL, pathRef, CFSTR(""));
if (unescPathRef)
documentBase = CFURLCreateWithFileSystemPath(NULL, unescPathRef, kCFURLHFSPathStyle, false);
}
}
} else {
documentBase = CFURLCreateWithBytes(NULL, (const UInt8*)mDocumentBase,