From 8dea72a38cec1f6c095beb86ad57333fc7564f41 Mon Sep 17 00:00:00 2001 From: Angus Leeming Date: Tue, 10 Jun 2003 13:37:25 +0000 Subject: [PATCH] (copyFileToDir): ensure temp files have unique names. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7139 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/support/ChangeLog | 3 +++ src/support/filetools.C | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/support/ChangeLog b/src/support/ChangeLog index e9faf877e9..04f9a86f39 100644 --- a/src/support/ChangeLog +++ b/src/support/ChangeLog @@ -1,3 +1,6 @@ +2003-06-10 Angus Leeming + + * filetools.C (copyFileToDir): ensure that temp files have unique names. 2003-06-04 André Pönitz diff --git a/src/support/filetools.C b/src/support/filetools.C index c808c461a8..540b9e4f92 100644 --- a/src/support/filetools.C +++ b/src/support/filetools.C @@ -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 -- 2.39.2