]> git.lyx.org Git - features.git/commitdiff
Fix spurious error message about nonexisting directory.
authorGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Thu, 30 Nov 2006 15:21:23 +0000 (15:21 +0000)
committerGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Thu, 30 Nov 2006 15:21:23 +0000 (15:21 +0000)
* src/buffer.C
(Buffer::save): Only try to make a backup if the buffer file already
exists. The try ... catch mechanism is fine, but when it was
introduced ot was overseen that copying a file could not only fail
because the destination dir does not exist, but also because the
source does not exist.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16121 a592a061-630c-0410-9148-cb99ea01b6c8

Status.15x
src/buffer.C

index 91151018760cc6942886d7e2dffb76178d62eb72..fcacbcd436112eecb90cca55b84dfb3a67ff94a2 100644 (file)
@@ -29,11 +29,6 @@ GENERAL
 
 FILE
 
-* When I "Save as..." in /tmp, I get a Backup error popup about non writable 
-  /tmp, which is obviously not true.  The file is there, and if I try to Save
-  as again, I get the overwrite popup warning twice: once in English, once 
-  in French. (J. P. Chretien)
-
 * Loading de_Userguide.lyx results in two parse errors:
   Paragraph ended in line 21206
   Missing \end_layout.
@@ -453,3 +448,10 @@ CREDITS:
   c:\> lyx-qt4.exe -geometry 800x600+100+30
   Wrong command line option `-geometry'. Exiting.
   FIXED (Peter, 2006-11-29)
+
+* When I "Save as..." in /tmp, I get a Backup error popup about non writable 
+  /tmp, which is obviously not true.  The file is there, and if I try to Save
+  as again, I get the overwrite popup warning twice: once in English, once 
+  in French. (J. P. Chretien)
+  FIXED (Michael (found the problem), Georg (fix), 2006-11-30)
+
index e491ab52516416a76a5da0857d0785016943bf01..e3bf85ad0c0cc49f51375c1dec1b294a7b7e5a30 100644 (file)
@@ -715,9 +715,9 @@ bool Buffer::save() const
        // We don't need autosaves in the immediate future. (Asger)
        resetAutosaveTimers();
 
-       // make a backup
+       // make a backup if the file already exists
        string s;
-       if (lyxrc.make_backup) {
+       if (lyxrc.make_backup && fs::exists(fileName())) {
                s = fileName() + '~';
                if (!lyxrc.backupdir_path.empty())
                        s = addName(lyxrc.backupdir_path,