From 81f63f6670e3226e307e4f8d8f48a6739893378a Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Fri, 4 Jul 2008 12:28:55 +0000 Subject: [PATCH] Remove double slash in system temporary path. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25442 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/support/Package.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/support/Package.cpp b/src/support/Package.cpp index 80615ed5cd..10134a414d 100644 --- a/src/support/Package.cpp +++ b/src/support/Package.cpp @@ -375,7 +375,11 @@ FileName const get_temp_dir() // Typical example: C:/TEMP/. char path[MAX_PATH]; GetTempPath(MAX_PATH, path); - return FileName(to_utf8(from_local8bit(path))); + string tmp = to_utf8(from_local8bit(path)); + size_t const size = tmp.size(); + if (size && (tmp[size - 1] == '/' || tmp[size - 1] == '\\')) + tmp.erase(size - 1, 1); + return FileName(tmp); #else // Posix-like. return FileName("/tmp"); #endif