From: Enrico Forestieri Date: Sun, 21 Oct 2007 17:57:13 +0000 (+0000) Subject: Fix bug 4287 X-Git-Tag: 1.6.10~7733 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=eb9b8ef0cc8317bd831865a16be468927c59e043;p=lyx.git 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 --- 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;