mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +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);
|
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;
|
||||||
|
Loading…
Reference in New Issue
Block a user