summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2021-02-15 13:40:13 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2021-02-15 14:34:51 +0100
commit376101c41cf23852b19db5725b0257069f3abd2e (patch)
tree1590751bad51a0bb5b670e019fe18bdcfda1bc06 /sal
parent181fc61c4cce5192e57657c313ee7fa4f640fb69 (diff)
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@collabora.com>
Diffstat (limited to 'sal')
-rw-r--r--sal/osl/unx/tempfile.cxx2
1 files changed, 1 insertions, 1 deletions
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);