Remove double slash in system temporary path.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25442 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2008-07-04 12:28:55 +00:00
parent 979f5211a4
commit 81f63f6670

View File

@ -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