]> git.lyx.org Git - features.git/commitdiff
Fix bug 4287
authorEnrico Forestieri <forenr@lyx.org>
Sun, 21 Oct 2007 17:57:13 +0000 (17:57 +0000)
committerEnrico Forestieri <forenr@lyx.org>
Sun, 21 Oct 2007 17:57:13 +0000 (17:57 +0000)
* src/Buffer.cpp (Buffer::save): also replace the ':' character
in the mangled filename as this it is illegal on Windows.

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

src/Buffer.cpp

index 77d0267afce889246d9356400c06cfb916899cdd..e50a9745096ba590bb90211c2da9624eb51add46 100644 (file)
@@ -848,10 +848,13 @@ bool Buffer::save() const
        // make a backup if the file already exists
        if (lyxrc.make_backup && fs::exists(encodedFilename)) {
                backupName = FileName(absFileName() + '~');
-               if (!lyxrc.backupdir_path.empty())
+               if (!lyxrc.backupdir_path.empty()) {
+                       string const mangledName =
+                               subst(subst(os::internal_path(
+                               backupName.absFilename()), '/', '!'), ':', '!');
                        backupName = FileName(addName(lyxrc.backupdir_path,
-                                             subst(os::internal_path(backupName.absFilename()), '/', '!')));
-
+                                                     mangledName));
+               }
                try {
                        fs::copy_file(encodedFilename, backupName.toFilesystemEncoding(), false);
                        madeBackup = true;