cppuhelper/source/shlib.cxx |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 269b588647bb8435a0f3cb8b6c01cdd1c006e8ed
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Sun Mar 30 12:57:31 2025 +0100
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Sun Mar 30 15:08:33 2025 +0200

    Use osl_getEnvironment instead of getenv
    
    Fix a TODO
    
    Change-Id: I8647b6b90f3fb50180363f8241f27329be426a1a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183505
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/cppuhelper/source/shlib.cxx b/cppuhelper/source/shlib.cxx
index afc96beaa76c..2cf101e4d17a 100644
--- a/cppuhelper/source/shlib.cxx
+++ b/cppuhelper/source/shlib.cxx
@@ -36,6 +36,7 @@
 #include <cppuhelper/shlib.hxx>
 #include <o3tl/string_view.hxx>
 #include <osl/module.hxx>
+#include <osl/process.h>
 #include <sal/log.hxx>
 #include <uno/environment.hxx>
 #include <uno/mapping.hxx>
@@ -51,13 +52,12 @@ css::uno::Environment cppuhelper::detail::getEnvironment(
 {
     OUString n(name);
     if (!implementation.empty()) {
-        static char const * log = std::getenv("UNO_ENV_LOG");
-        if (log != nullptr && *log != 0) {
-            OString imps(log);
+        OUString imps;
+        if (osl_getEnvironment(u"UNO_ENV_LOG"_ustr.pData, &imps.pData) == 
osl_Process_E_None
+            && !imps.isEmpty()) {
             for (sal_Int32 i = 0; i != -1;) {
-                std::string_view imp(o3tl::getToken(imps, 0, ';', i));
-                //TODO: this assumes UNO_ENV_LOG only contains ASCII 
characters:
-                if (o3tl::equalsAscii(implementation, imp))
+                std::u16string_view imp(o3tl::getToken(imps, 0, ';', i));
+                if (implementation == imp)
                 {
                     n += ":log";
                     break;

Reply via email to