[Libreoffice-commits] core.git: sal/osl

Mike Kaganski (via logerrit) logerrit at kemper.freedesktop.org
Mon Feb 15 13:35:38 UTC 2021


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

New commits:
commit 376101c41cf23852b19db5725b0257069f3abd2e
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Mon Feb 15 13:40:13 2021 +0300
Commit:     Mike Kaganski <mike.kaganski at 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.kaganski at 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);


More information about the Libreoffice-commits mailing list