Fix for bug 178546 (regression: addFile (AppleSingle) doesn't work on Mac OS X ). r=dveditz, sr=jst.
git-svn-id: svn://10.0.0.236/trunk@163077 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -237,7 +237,7 @@ PRInt32 ScheduleFileForDeletion(nsIFile *filename)
|
||||
|
||||
PRInt32 ReplaceFileNow(nsIFile* aReplacementFile, nsIFile* aDoomedFile )
|
||||
{
|
||||
PRBool flagExists, flagIsEqual;
|
||||
PRBool flagExists, flagRenamedDoomedFileExists, flagIsEqual;
|
||||
nsCOMPtr<nsIFile> replacementFile;
|
||||
nsresult rv;
|
||||
|
||||
@@ -262,8 +262,8 @@ PRInt32 ReplaceFileNow(nsIFile* aReplacementFile, nsIFile* aDoomedFile )
|
||||
nsCOMPtr<nsILocalFile> tmpLocalFile;
|
||||
|
||||
aDoomedFile->Clone(getter_AddRefs(renamedDoomedFile));
|
||||
renamedDoomedFile->Exists(&flagExists);
|
||||
if ( flagExists )
|
||||
renamedDoomedFile->Exists(&flagRenamedDoomedFileExists);
|
||||
if ( flagRenamedDoomedFileExists )
|
||||
{
|
||||
#ifdef XP_MACOSX
|
||||
// If we clone an nsIFile, and move the clone, the FSRef of the *original*
|
||||
@@ -370,9 +370,12 @@ PRInt32 ReplaceFileNow(nsIFile* aReplacementFile, nsIFile* aDoomedFile )
|
||||
|
||||
if (NS_SUCCEEDED(rv))
|
||||
{
|
||||
// we replaced the old file OK, now we have to
|
||||
// get rid of it if it was renamed out of the way
|
||||
result = DeleteFileNowOrSchedule( renamedDoomedFile );
|
||||
if (flagRenamedDoomedFileExists)
|
||||
{
|
||||
// we replaced the old file OK, now we have to
|
||||
// get rid of it if it was renamed out of the way
|
||||
result = DeleteFileNowOrSchedule( renamedDoomedFile );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user