From: Georg Baum Date: Fri, 4 Jul 2014 19:06:49 +0000 (+0200) Subject: Don't guess whether autosave succeeded X-Git-Tag: 2.2.0alpha1~1800 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=50467f3f554129b6ff532f4433da27e9b76aff55;p=features.git Don't guess whether autosave succeeded writeFile() tells whether it could save the file, so use the return value instead of guessing. --- diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 10e7a277fd..4331309857 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -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;