diff --git a/src/ChangeLog b/src/ChangeLog index cfe1d55e42..889cb344b0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2006-08-08 Jürgen Spitzmüller + + * buffer.C (save): Check if the backup directory is valid and + writeable, and warn the user if not (instead of letting boost + assert) [bug 2740]. + 2006-08-08 Georg Baum * LaTeX.C (deplog): Add the toc file to the dependencies if a line diff --git a/src/buffer.C b/src/buffer.C index 0768c8add2..13648396b9 100644 --- a/src/buffer.C +++ b/src/buffer.C @@ -701,7 +701,10 @@ bool Buffer::save() const // good enough. (Lgb) // But to use this we need fs::copy_file to actually do a copy, // even when the target file exists. (Lgb) - if (fs::exists(fileName()) && fs::is_writable(fs::path(fileName()).branch_path())) { + if (fs::exists(fileName()) + && fs::is_writable(fs::path(fileName()).branch_path()) + && fs::exists(fs::path(s).branch_path()) + && fs::is_writable(fs::path(s).branch_path())) { //try { fs::copy_file(fileName(), s, false); //} @@ -709,6 +712,11 @@ bool Buffer::save() const //lyxerr << "LyX was not able to make backup copy. Beware.\n" // << fe.what() << endl; //} + } else { + Alert::error(_("Backup failure"), + bformat(_("LyX was not able to make a backup copy in %1$s.\n" + "Please check if the directory exists and is writeable."), + fs::path(s).branch_path().native_directory_string())); } } diff --git a/status.14x b/status.14x index 9928f7ee23..d1af6f695e 100644 --- a/status.14x +++ b/status.14x @@ -26,6 +26,9 @@ What's new * Document Input/Output +- Fix crash on save (including dataloss) when the backup directory + was invalid or not writeable(bug 2740). + - Fix crash when importing LaTeX files with no text (bug 2667) - Ignore definition of lyxgreyout environment when re-importing a LyX