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); tempfile.setAutoRemove(false);
FileName const tmp_ret = tempfile.name(); FileName const tmp_ret = tempfile.name();
if (!tmp_ret.empty()) { if (!tmp_ret.empty()) {
buffer_.writeFile(tmp_ret); if (!buffer_.writeFile(tmp_ret))
// assume successful write of tmp_ret failed = true;
if (!tmp_ret.moveTo(fname_)) else if (!tmp_ret.moveTo(fname_))
failed = true; failed = true;
} else } else
failed = true; failed = true;