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

git-svn-id: svn://10.0.0.236/trunk@150392 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
darin%meer.net
2003-12-17 06:02:57 +00:00
parent 71be3fb1af
commit 00b5dfa469

View File

@@ -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);