mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-10 20:04:46 +00:00
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:
parent
22dcdd6d8f
commit
50467f3f55
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user