From eb9b8ef0cc8317bd831865a16be468927c59e043 Mon Sep 17 00:00:00 2001 From: Enrico Forestieri Date: Sun, 21 Oct 2007 17:57:13 +0000 Subject: [PATCH] Fix bug 4287 * 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 | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 77d0267afc..e50a974509 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -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; -- 2.39.5