sal/osl/unx/tempfile.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 376101c41cf23852b19db5725b0257069f3abd2e
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Mon Feb 15 13:40:13 2021 +0300
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Mon Feb 15 14:34:51 2021 +0100

    Do not remove '/' when it's the only character in the path
    
    Follow-up to commit 3380163bc0fb9dab7f289cc36b0eeb0c9b3ddaa9.
    
    Change-Id: I5e895755cb4b2432c8ac423d254f493764dead75
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110899
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/sal/osl/unx/tempfile.cxx b/sal/osl/unx/tempfile.cxx
index b91d4b6e0ac7..00ae0664b2c0 100644
--- a/sal/osl/unx/tempfile.cxx
+++ b/sal/osl/unx/tempfile.cxx
@@ -51,7 +51,7 @@ oslFileError SAL_CALL osl_getTempDirURL( rtl_uString** 
pustrTempDir )
         pValue = "/tmp";
 
     auto nLen = strlen(pValue);
-    while (nLen && pValue[nLen - 1] == '/')
+    while (nLen > 1 && pValue[nLen - 1] == '/') // Allow path consisting of 
single "/"
         --nLen;
     rtl_string2UString( &ustrTempPath, pValue, nLen, 
osl_getThreadTextEncoding(), OSTRING_TO_OUSTRING_CVTFLAGS );
     assert(ustrTempPath);
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to