From 74260098ffcc14b4991ff424f5326a62bc003399 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 3 Sep 2021 11:40:20 +0100 Subject: log PATH length and content when complaining about it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I54495044f2bd487eb9315c7a974b9859b26235a2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121588 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- sal/cppunittester/cppunittester.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'sal') 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 -- cgit