Don't guess whether autosave succeeded

writeFile() tells whether it could save the file, so use the return value
instead of guessing.
This commit is contained in:
Georg Baum 2014-07-04 21:06:49 +02:00
parent 22dcdd6d8f
commit 50467f3f55

View File

@ -3738,9 +3738,9 @@ int AutoSaveBuffer::generateChild()
tempfile.setAutoRemove(false);
FileName const tmp_ret = tempfile.name();
if (!tmp_ret.empty()) {
buffer_.writeFile(tmp_ret);
// assume successful write of tmp_ret
if (!tmp_ret.moveTo(fname_))
if (!buffer_.writeFile(tmp_ret))
failed = true;
else if (!tmp_ret.moveTo(fname_))
failed = true;
} else
failed = true;