diff --git a/Source/CTest/cmCTestLaunchReporter.cxx b/Source/CTest/cmCTestLaunchReporter.cxx index 41e725fb90..6ec7d0e395 100644 --- a/Source/CTest/cmCTestLaunchReporter.cxx +++ b/Source/CTest/cmCTestLaunchReporter.cxx @@ -2,8 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCTestLaunchReporter.h" -#include - #include "cmsys/FStream.hxx" #include "cmsys/Process.h" #include "cmsys/RegularExpression.hxx" @@ -48,8 +46,8 @@ void cmCTestLaunchReporter::ComputeFileNames() { // We just passthru the behavior of the real command unless the // CTEST_LAUNCH_LOGS environment variable is set. - const char* d = getenv("CTEST_LAUNCH_LOGS"); - if (!(d && *d)) { + std::string d; + if (!cmSystemTools::GetEnv("CTEST_LAUNCH_LOGS", d) || d.empty()) { return; } this->Passthru = false;