fixes tinderbox orange (see bug 132517 for more info) sr=bryner

This commit is contained in:
darin%meer.net 2003-12-17 06:02:57 +00:00
Родитель 4ffb5ed32a
Коммит 101e3f5046
1 изменённых файлов: 13 добавлений и 0 удалений

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

@ -77,6 +77,19 @@ nsresult nsSafeSaveFile::OnSaveFinished(PRBool aSaveSucceeded, PRBool aBackupTar
if (aSaveSucceeded) {
NS_ENSURE_STATE(mTargetFile && mTempFile);
if (!mTargetFileExists) {
// If the target file did not exist when we were initialized, then the
// temp file we gave out was actually a reference to the target file.
// since we succeeded in writing to the temp file (and hence succeeded
// in writing to the target file), there is nothing more to do.
#ifdef DEBUG
PRBool equal;
if (NS_FAILED(mTargetFile->Equals(mTempFile, &equal)) || !equal)
NS_ERROR("mTempFile not equal to mTargetFile");
#endif
return NS_OK;
}
nsCAutoString targetFilename;
rv = mTargetFile->GetNativeLeafName(targetFilename);