(copyFileToDir): ensure temp files have unique names.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7139 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Angus Leeming 2003-06-10 13:37:25 +00:00
parent 445ae0da6f
commit 8dea72a38c
2 changed files with 6 additions and 0 deletions

View File

@ -1,3 +1,6 @@
2003-06-10 Angus Leeming <leeming@lyx.org>
* filetools.C (copyFileToDir): ensure that temp files have unique names.
2003-06-04 André Pönitz <poenitz@gmx.net>

View File

@ -1337,6 +1337,9 @@ string copyFileToDir(string const & path, string const & file_in)
file_out = subst(file_out, "/", "_");
// Replace '.' in the file name with '_'
file_out = subst(file_out, ".", "_");
// Append a unique ID
static int id;
file_out += '_' + tostr(id++);
// Add the extension back on
file_out = ChangeExtension(file_out, GetExtension(file_in));
// Put this file in the buffer's temp dir