diff --git a/mozilla/xpcom/io/nsDirectoryService.cpp b/mozilla/xpcom/io/nsDirectoryService.cpp index f6aec843301..154c4380d76 100644 --- a/mozilla/xpcom/io/nsDirectoryService.cpp +++ b/mozilla/xpcom/io/nsDirectoryService.cpp @@ -167,7 +167,7 @@ nsDirectoryService::GetCurrentProcessDirectory(nsILocalFile** aFile) // get info for the the current process to determine the directory // its located in OSErr err; - ProcessSerialNumber psn = {kNoProcess, kCurrentProcess}; + ProcessSerialNumber psn = {kNoProcess, kCurrentProcess}; ProcessInfoRec pInfo; FSSpec tempSpec; @@ -180,11 +180,10 @@ nsDirectoryService::GetCurrentProcessDirectory(nsILocalFile** aFile) err = GetProcessInformation(&psn, &pInfo); if (!err) { - FSSpec appFSSpec = *(pInfo.processAppSpec); + // create an FSSpec from the volume and dirid of the app. + FSSpec appFSSpec; + ::FSMakeFSSpec(pInfo.processAppSpec->vRefNum, pInfo.processAppSpec->parID, 0, &appFSSpec); - // Truncate the nsame so the spec is just to the app directory - appFSSpec.name[0] = 0; - nsCOMPtr localFileMac = do_QueryInterface((nsIFile*)localFile); if (localFileMac) {