From a7a84d9a5468385e7d208915c3a077c5268a0b3d Mon Sep 17 00:00:00 2001 From: "ssu%netscape.com" Date: Thu, 8 Jun 2000 00:31:06 +0000 Subject: [PATCH] fixing bug #37168 - fixing the mac side of the bug. Install.Execute() now works on the Mac. precheckin tests=passed r=sgehani git-svn-id: svn://10.0.0.236/trunk@71743 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/xpcom/io/nsLocalFileMac.cpp | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/mozilla/xpcom/io/nsLocalFileMac.cpp b/mozilla/xpcom/io/nsLocalFileMac.cpp index 1a805c86a62..b33728478ee 100644 --- a/mozilla/xpcom/io/nsLocalFileMac.cpp +++ b/mozilla/xpcom/io/nsLocalFileMac.cpp @@ -1390,14 +1390,27 @@ nsLocalFile::MoveTo(nsIFile *newParentDir, const char *newName) NS_IMETHODIMP nsLocalFile::Spawn(const char **args, PRUint32 count) { + OSErr err = noErr; + LaunchParamBlockRec launchPB; PRBool isFile; nsresult rv = IsFile(&isFile); if (NS_FAILED(rv)) return rv; + launchPB.launchAppSpec = &mTargetSpec; + launchPB.launchAppParameters = NULL; + launchPB.launchBlockID = extendedBlock; + launchPB.launchEPBLength = extendedBlockLen; + launchPB.launchFileFlags = NULL; + launchPB.launchControlFlags = launchContinue + launchNoFileFlags + launchUseMinimum; + launchPB.launchControlFlags += launchDontSwitch; - return NS_ERROR_FILE_EXECUTION_FAILED; + err = LaunchApplication(&launchPB); + if (err != noErr) + return MacErrorMapper(err); + + return NS_OK; } NS_IMETHODIMP @@ -2376,8 +2389,11 @@ NS_IMETHODIMP nsLocalFile::GetInitType(nsLocalFileMacInitType *type) NS_IMETHODIMP nsLocalFile::InitWithFSSpec(const FSSpec *fileSpec) { MakeDirty(); - mSpec = *fileSpec; - mInitType = eInitWithFSSpec; + mSpec = *fileSpec; + mResolvedSpec = *fileSpec; + mTargetSpec = *fileSpec; + mAppendedPath = ""; + mInitType = eInitWithFSSpec; return NS_OK; }