From e19ce156aeff55ea4edae1795f9123549ca73a40 Mon Sep 17 00:00:00 2001 From: "dougt%netscape.com" Date: Mon, 14 Aug 2000 22:33:45 +0000 Subject: [PATCH] Fix for 48832, r=conrad. a regression. --- extensions/psm-glue/src/nsPSMComponent.cpp | 31 ++++++++++++---------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/extensions/psm-glue/src/nsPSMComponent.cpp b/extensions/psm-glue/src/nsPSMComponent.cpp index feb5111d3f3d..aa5ff4f27d46 100644 --- a/extensions/psm-glue/src/nsPSMComponent.cpp +++ b/extensions/psm-glue/src/nsPSMComponent.cpp @@ -44,7 +44,7 @@ #include "nsILocalFile.h" #include "nsDirectoryService.h" - +#include "nsDirectoryServiceDefs.h" #include "rsrcids.h" #include "nsPSMMutex.h" @@ -483,23 +483,26 @@ nsPSMComponent::GetControlConnection( CMT_CONTROL * *_retval ) NS_WITH_SERVICE(nsIProperties, directoryService, NS_DIRECTORY_SERVICE_PROGID, &rv); if (NS_FAILED(rv)) return rv; - directoryService->Get("system.OS_CurrentProcessDirectory", + directoryService->Get( NS_XPCOM_CURRENT_PROCESS_DIR, NS_GET_IID(nsIFile), getter_AddRefs(psmAppFile)); - - psmAppFile->Append("psm"); - psmAppFile->Append(PSM_FILE_NAME); - - PRBool isExecutable, exists; - psmAppFile->Exists(&exists); - psmAppFile->IsExecutable(&isExecutable); - if (exists && isExecutable) + if (psmAppFile) { - nsXPIDLCString path; - psmAppFile->GetPath(getter_Copies(path)); - // FIX THIS. using a file path is totally wrong here. - mControl = CMT_EstablishControlConnection((char*)(const char*)path, &nsPSMShimTbl, &nsPSMMutexTbl); + psmAppFile->Append("psm"); + psmAppFile->Append(PSM_FILE_NAME); + + PRBool isExecutable, exists; + psmAppFile->Exists(&exists); + psmAppFile->IsExecutable(&isExecutable); + if (exists && isExecutable) + { + nsXPIDLCString path; + psmAppFile->GetPath(getter_Copies(path)); + // FIX THIS. using a file path is totally wrong here. + mControl = CMT_EstablishControlConnection((char*)(const char*)path, &nsPSMShimTbl, &nsPSMMutexTbl); + + } } }