Don't forget the Windows drive name when mangling the temporary file name.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9393 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Angus Leeming 2004-12-17 12:30:48 +00:00
parent 3dd565beae
commit c7d1778e3f
2 changed files with 13 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2004-12-16 Angus Leeming <leeming@lyx.org>
* filename.C (mangledFilename): Given a Windows-style path, don't
forget to mangle the drive letter too when generating a unique
temporary file name.
2004-12-16 Angus Leeming <leeming@lyx.org>
* mkdir.C: move the HAVE_MKDIR conditional code out of config.h

View File

@ -86,6 +86,13 @@ string const FileName::mangledFilename() const
mname = subst(mname, ".", "_");
// Add the extension back on
mname = ChangeExtension(mname, GetExtension(name_));
#if defined(__CYGWIN__) || defined(__CYGWIN32__) || defined(_WIN32)
// Mangle the drive letter in a Windows-style path.
if (mname.size() >= 2 && mname[1] == ':')
mname[1] = '_';
#endif
// Prepend a counter to the filename. This is necessary to make
// the mangled name unique.
static int counter = 0;