Commit 923b3348 authored by dougt%netscape.com's avatar dougt%netscape.com
Browse files

Make it work on the mac.

parent e985a85e
Loading
Loading
Loading
Loading
+10 −9
Original line number Diff line number Diff line
@@ -1147,7 +1147,7 @@ PRInt32
nsInstall::ExtractFileFromJar(const nsString& aJarfile, nsFileSpec* aSuggestedName, nsFileSpec** aRealName)
{
    PRInt32 result;
    const char* extractFileHere;
    nsFilePath*  extractFileHere = nsnull;
    
    nsSpecialSystemDirectory tempFile(nsSpecialSystemDirectory::OS_TemporaryDirectory);
        
@@ -1171,27 +1171,28 @@ nsInstall::ExtractFileFromJar(const nsString& aJarfile, nsFileSpec* aSuggestedNa
        // Create a temporary file to extract to.
        tempFile.MakeUnique();
   
        extractFileHere = tempFile.operator const char* ();
        extractFileHere = new nsFilePath(tempFile);
    }
    else
    {
        // extract to the final destination.
        extractFileHere =  aSuggestedName->operator const char* ();
    	extractFileHere = new nsFilePath(*aSuggestedName);
    }

    // Return the filepath that we extracted to:

    nsFileSpec *fileSpec = new nsFileSpec(extractFileHere);
    nsFileSpec *fileSpec = new nsFileSpec(*extractFileHere);

    // FIX:  We will overwrite what is in the way.  is this something that we want to do?  
    fileSpec->Delete(PR_FALSE);

    result  = ZIP_ExtractFile( mJarFileData, nsAutoCString(aJarfile), extractFileHere );
    result  = ZIP_ExtractFile( mJarFileData, nsAutoCString(aJarfile), (*extractFileHere) );
    
    if (result == 0)
        *aRealName = fileSpec;
	
    //delete [] extractFileHere;
	if (extractFileHere != nsnull)
    	delete extractFileHere;

    return result;
}
+2 −0
Original line number Diff line number Diff line
@@ -24,6 +24,8 @@
#include "nsString.h"
#include "nsInstallErrorMessages.h"

#error  
/// Need to rewrite!


char * 
+1 −1
Original line number Diff line number Diff line
@@ -68,7 +68,7 @@ PRInt32 nsInstallExecute::Complete()
    if (mExecutableFile == nsnull)
        return nsInstall::INVALID_ARGUMENTS;

    nsFileSpec appPath( *mExecutableFile, false);
    nsFileSpec appPath( *mExecutableFile);
    
    if (!appPath.Exists())
	{
+1 −1
Original line number Diff line number Diff line
@@ -169,7 +169,7 @@ PRInt32 nsInstallFile::CompleteFileMove()
        return -1;
    }
   	
    if ( mExtracedFile->Equals(*mFinalFile) ) 
    if ( *mExtracedFile == *mFinalFile ) 
    {
        /* No need to rename, they are the same */
        result = 0;
+5 −1
Original line number Diff line number Diff line
@@ -95,8 +95,12 @@ nsInstallFolder::~nsInstallFolder()
void 
nsInstallFolder::GetDirectoryPath(nsString& aDirectoryPath)
{
	// We want the a NATIVE path.
	
    aDirectoryPath.SetLength(0);
    aDirectoryPath.Append(*mUrlPath);
    
    // FIX NSFILESPEC - we need to have a GetDisplayString.
    aDirectoryPath.Append(nsFilePath(*mUrlPath));
}


Loading