vcl/source/gdi/embeddedfontsmanager.cxx |   14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

New commits:
commit d5b0462581c92c3b524494130b727822438432e7
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Fri Aug 15 11:09:56 2025 +0500
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Fri Aug 15 10:38:42 2025 +0200

    LOK: make sure to have trailing slash in GetEmbeddedFontsRoot()
    
    An overlook from commit 49509ba5221768327ac2d61f8dc3e8dd038ee753 (LOK:
    Set up directory for temporary embedded font files, 2025-08-15).
    
    Change-Id: Ib14640b9f6c35c799cf9409165f2d51bb8ef344c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189656
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/vcl/source/gdi/embeddedfontsmanager.cxx 
b/vcl/source/gdi/embeddedfontsmanager.cxx
index 2451761e6035..66b01ba36581 100644
--- a/vcl/source/gdi/embeddedfontsmanager.cxx
+++ b/vcl/source/gdi/embeddedfontsmanager.cxx
@@ -63,16 +63,20 @@ OUString GetStandardEmbeddedFontsRoot()
 {
     OUString p = u"${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" 
SAL_CONFIGFILE("bootstrap") "::UserInstallation}"_ustr;
     rtl::Bootstrap::expandMacros(p);
-    (void)osl::FileBase::getAbsoluteFileURL({}, p + 
"/user/temp/embeddedfonts/", p);
+    return p + "/user/temp/embeddedfonts";
+}
+
+OUString GetEmbeddedFontsRootURL(bool bLOK)
+{
+    OUString p = bLOK ? utl::CreateTempURL(nullptr, true) : 
GetStandardEmbeddedFontsRoot();
+    // Drop things like "//" and "/../"; ensure trailing slash
+    (void)osl::FileBase::getAbsoluteFileURL({}, p + "/", p);
     return p;
 }
 
 const OUString& GetEmbeddedFontsRoot()
 {
-    // [-loplugin:stringstatic] false positive: the initializer is not a 
constant expression
-    static const OUString path = comphelper::LibreOfficeKit::isActive()
-                                     ? utl::CreateTempURL(nullptr, true)
-                                     : GetStandardEmbeddedFontsRoot();
+    static const OUString path = 
GetEmbeddedFontsRootURL(comphelper::LibreOfficeKit::isActive());
     return path;
 }
 

Reply via email to