mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Bug 1331820 - Fix misuse of NS_NewNativeLocalFile in netwerk/. r=jduell
MozReview-Commit-ID: 6OKqRLhGJpm --HG-- extra : rebase_source : 39bf499ef8e24c6bc7818e087564d19b5158212d
This commit is contained in:
parent
2f33a39f13
commit
c82e3f0369
@ -257,7 +257,11 @@ nsFileChannel::nsFileChannel(nsIURI *uri)
|
||||
// can point to different resources right after the first resource is loaded.
|
||||
nsCOMPtr<nsIFile> file;
|
||||
nsCOMPtr <nsIURI> targetURI;
|
||||
#ifdef XP_WIN
|
||||
nsAutoString fileTarget;
|
||||
#else
|
||||
nsAutoCString fileTarget;
|
||||
#endif
|
||||
nsCOMPtr<nsIFile> resolvedFile;
|
||||
bool symLink;
|
||||
nsCOMPtr<nsIFileURL> fileURL = do_QueryInterface(uri);
|
||||
@ -265,9 +269,15 @@ nsFileChannel::nsFileChannel(nsIURI *uri)
|
||||
NS_SUCCEEDED(fileURL->GetFile(getter_AddRefs(file))) &&
|
||||
NS_SUCCEEDED(file->IsSymlink(&symLink)) &&
|
||||
symLink &&
|
||||
#ifdef XP_WIN
|
||||
NS_SUCCEEDED(file->GetTarget(fileTarget)) &&
|
||||
NS_SUCCEEDED(NS_NewLocalFile(fileTarget, PR_TRUE,
|
||||
getter_AddRefs(resolvedFile))) &&
|
||||
#else
|
||||
NS_SUCCEEDED(file->GetNativeTarget(fileTarget)) &&
|
||||
NS_SUCCEEDED(NS_NewNativeLocalFile(fileTarget, PR_TRUE,
|
||||
getter_AddRefs(resolvedFile))) &&
|
||||
#endif
|
||||
NS_SUCCEEDED(NS_NewFileURI(getter_AddRefs(targetURI),
|
||||
resolvedFile, nullptr))) {
|
||||
// Make an effort to match up the query strings.
|
||||
|
Loading…
Reference in New Issue
Block a user