sal/cppunittester/cppunittester.cxx |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 74260098ffcc14b4991ff424f5326a62bc003399
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Fri Sep 3 11:40:20 2021 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Fri Sep 3 20:59:48 2021 +0200

    log PATH length and content when complaining about it
    
    Change-Id: I54495044f2bd487eb9315c7a974b9859b26235a2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121588
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/sal/cppunittester/cppunittester.cxx 
b/sal/cppunittester/cppunittester.cxx
index 9e4c6e2c048b..2002eb0efb2d 100644
--- a/sal/cppunittester/cppunittester.cxx
+++ b/sal/cppunittester/cppunittester.cxx
@@ -271,15 +271,16 @@ public:
             manager->load(testlib, args);
         } catch (const CppUnit::DynamicLibraryManagerException &e) {
             std::cerr << "DynamicLibraryManagerException: \"" << e.what() << 
"\"\n";
-#ifdef _WIN32
             const char *pPath = getenv ("PATH");
-            if (pPath && strlen (pPath) > 256)
+            const size_t nPathLen = pPath ? strlen(pPath) : 0;
+#ifdef _WIN32
+            if (nPathLen > 256)
             {
                 std::cerr << "Windows has significant build problems with long 
PATH variables ";
                 std::cerr << "please check your PATH variable and 
re-autogen.\n";
             }
 #endif
-            std::cerr << "Path is '" << getenv("PATH") << "'\n";
+            std::cerr << "Path (length: " << nPathLen << ") is '" << pPath << 
"'\n";
             return false;
         }
 #endif

Reply via email to