Backing myself out to see if this caused btek to go orange.

This commit is contained in:
bnesse%netscape.com 2002-08-23 18:36:03 +00:00
Родитель 23625d6f94
Коммит ea32eb222e
1 изменённых файлов: 9 добавлений и 3 удалений

Просмотреть файл

@ -94,8 +94,9 @@ nsSafeSaveFile::~nsSafeSaveFile(void)
nsresult nsSafeSaveFile::CreateBackup(PurgeBackupType aPurgeType)
{
nsresult rv, rv2;
PRBool bExists;
nsCOMPtr<nsIFile> backupParent;
nsresult rv, rv2;
PRBool bExists;
// if the target file doesn't exist there is nothing to backup
if (!mTargetFileExists)
@ -109,10 +110,15 @@ nsresult nsSafeSaveFile::CreateBackup(PurgeBackupType aPurgeType)
return rv;
}
// Ugh, copy only takes a directory and a name, lets "unpackage" our target file...
rv = mBackupFile->GetParent(getter_AddRefs(backupParent));
if (NS_FAILED(rv))
return rv;
// and finally, copy the file (preserves file permissions)
rv2 = NS_OK;
do {
rv = mTargetFile->CopyToNative(nsnull, mBackupFileName);
rv = mTargetFile->CopyToNative(backupParent, mBackupFileName);
if (NS_SUCCEEDED(rv))
break;