mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 06:11:37 +00:00
Fix for bug 178546 (regression: addFile (AppleSingle) doesn't work on Mac OS X ). r=dveditz, sr=jst.
This commit is contained in:
parent
5009ca4eb7
commit
2116663b00
@ -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
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user