]> git.lyx.org Git - lyx.git/commitdiff
use is_writable to check if the copy_file will work
authorLars Gullik Bjønnes <larsbj@gullik.org>
Wed, 11 May 2005 16:42:12 +0000 (16:42 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Wed, 11 May 2005 16:42:12 +0000 (16:42 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9934 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/buffer.C

index c7463cf8196fc81ef67a3fa7f1519532d0b3ac08..a2ab230f32920476ed14fd81091b1780457840d7 100644 (file)
@@ -1,3 +1,8 @@
+2005-05-11  Lars Gullik Bjonnes  <larsbj@gullik.net>
+
+       * buffer.C (save): check if destination is writable before trying
+       to copy a file
+
 2005-05-11  Martin Vermeer  <martin.vermeer@hut.fi>
 
        * BufferView_pimpl.C (update): fix processEvents -caused update
index ab9a0db5d673841486e0d62c91aac8f91b83e918..90cc72c46fc8a4b0bfbaa43ec0b35201850b1400 100644 (file)
@@ -707,7 +707,7 @@ 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())) {
+               if (fs::exists(fileName()) && fs::is_writable(fs::path(fileName()).branch_path())) {
                  //try {
                    fs::copy_file(fileName(), s, false);
                    //}