]> git.lyx.org Git - features.git/commitdiff
please JMarc
authorAbdelrazak Younes <younes@lyx.org>
Fri, 4 Jul 2008 13:14:20 +0000 (13:14 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Fri, 4 Jul 2008 13:14:20 +0000 (13:14 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25444 a592a061-630c-0410-9148-cb99ea01b6c8

src/support/Package.cpp

index 10134a414d70beb56b1fa0d786227ea13e0b59e9..c0a84e9a1150d05fc31f07d7db1dd21155fb1d34 100644 (file)
@@ -375,11 +375,8 @@ FileName const get_temp_dir()
        // Typical example: C:/TEMP/.
        char path[MAX_PATH];
        GetTempPath(MAX_PATH, 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);
+       // Remove trailing backslash if any.
+       return FileName(rtrim(to_utf8(from_local8bit(path)), "\\"));
 #else // Posix-like.
        return FileName("/tmp");
 #endif