Fix bug #9544: Mark file clean after we write it.

This commit is contained in:
Richard Heck 2015-05-17 16:11:39 -04:00
parent f1832074f0
commit 61448d8cb2

View File

@ -1336,8 +1336,12 @@ bool Buffer::save() const
// if the file does not yet exist, none of the backup activity
// that follows is necessary
if (!fileName().exists())
return writeFile(fileName());
if (!fileName().exists()) {
if (!writeFile(fileName()))
return false;
markClean();
return true;
}
// we first write the file to a new name, then move it to its
// proper location once that has been done successfully. that