Get rid of FSRef usage in XRE_GetBinaryPath. Also resolve cached paths when initializing from CFURL sources. b=506812 r=vlad

This commit is contained in:
Josh Aas 2009-11-13 05:24:41 -05:00
parent 8c81f341a1
commit 953c7cb963
2 changed files with 2 additions and 8 deletions

View File

@ -1453,13 +1453,7 @@ XRE_GetBinaryPath(const char* argv0, nsILocalFile* *aResult)
if (!bundleURL)
return NS_ERROR_FAILURE;
FSRef fileRef;
if (!CFURLGetFSRef(bundleURL, &fileRef)) {
CFRelease(bundleURL);
return NS_ERROR_FAILURE;
}
rv = lfm->InitWithFSRef(&fileRef);
rv = lfm->InitWithCFURL(bundleURL);
CFRelease(bundleURL);
if (NS_FAILED(rv))

View File

@ -1936,7 +1936,7 @@ nsresult nsLocalFile::SetBaseURL(CFURLRef aCFURLRef)
::CFRelease(mBaseURL);
mBaseURL = aCFURLRef;
if (!::CFURLGetFileSystemRepresentation(mBaseURL, NO, (UInt8*)mPath, PATH_MAX))
if (!::CFURLGetFileSystemRepresentation(mBaseURL, true, (UInt8*)mPath, PATH_MAX))
return NS_ERROR_FAILURE;
return NS_OK;