зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset bc7ca663b817 (bug 1403366) because it depended on backed out bug 1405174. r=backout
This commit is contained in:
Родитель
a327457b39
Коммит
91443682cd
|
@ -65,12 +65,24 @@ nsDirectoryService::GetCurrentProcessDirectory(nsIFile** aFile)
|
|||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIFile> file;
|
||||
gService->Get(NS_XPCOM_INIT_CURRENT_PROCESS_DIR, NS_GET_IID(nsIFile),
|
||||
getter_AddRefs(file));
|
||||
if (file) {
|
||||
file.forget(aFile);
|
||||
return NS_OK;
|
||||
nsresult rv;
|
||||
|
||||
nsCOMPtr<nsIProperties> dirService;
|
||||
rv = nsDirectoryService::Create(nullptr,
|
||||
NS_GET_IID(nsIProperties),
|
||||
getter_AddRefs(dirService)); // needs to be around for life of product
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
if (dirService) {
|
||||
nsCOMPtr<nsIFile> localFile;
|
||||
dirService->Get(NS_XPCOM_INIT_CURRENT_PROCESS_DIR, NS_GET_IID(nsIFile),
|
||||
getter_AddRefs(localFile));
|
||||
if (localFile) {
|
||||
localFile.forget(aFile);
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
|
||||
RefPtr<nsLocalFile> localFile = new nsLocalFile;
|
||||
|
@ -109,7 +121,7 @@ nsDirectoryService::GetCurrentProcessDirectory(nsIFile** aFile)
|
|||
#ifdef DEBUG_conrad
|
||||
printf("nsDirectoryService - CurrentProcessDir is: %s\n", buffer);
|
||||
#endif
|
||||
nsresult rv = localFile->InitWithNativePath(nsDependentCString(buffer));
|
||||
rv = localFile->InitWithNativePath(nsDependentCString(buffer));
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
localFile.forget(aFile);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче