diff options
author | Dāvis Mosāns <davispuh@gmail.com> | 2016-07-07 21:54:05 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-07-18 13:51:01 (GMT) |
commit | b1f87a50b3aee129d420b8d789ebec55068e4ec5 (patch) | |
tree | e9223617c45d01c60a4c89c5d60dc0121a75a989 /Source/CPack | |
parent | 03407040d4d7d89fbb45e941a9dfb4257003a8a8 (diff) | |
download | CMake-b1f87a50b3aee129d420b8d789ebec55068e4ec5.zip CMake-b1f87a50b3aee129d420b8d789ebec55068e4ec5.tar.gz CMake-b1f87a50b3aee129d420b8d789ebec55068e4ec5.tar.bz2 |
Use better KWSys SystemTools::GetEnv and HasEnv signatures
Diffstat (limited to 'Source/CPack')
-rw-r--r-- | Source/CPack/cmCPackGenerator.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index df8bb0f..76609e1 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -1074,11 +1074,11 @@ const char* cmCPackGenerator::GetInstallPath() return this->InstallPath.c_str(); } #if defined(_WIN32) && !defined(__CYGWIN__) - const char* prgfiles = cmsys::SystemTools::GetEnv("ProgramFiles"); - const char* sysDrive = cmsys::SystemTools::GetEnv("SystemDrive"); - if (prgfiles) { + std::string prgfiles; + std::string sysDrive; + if (cmsys::SystemTools::GetEnv("ProgramFiles", prgfiles)) { this->InstallPath = prgfiles; - } else if (sysDrive) { + } else if (cmsys::SystemTools::GetEnv("SystemDrive", sysDrive)) { this->InstallPath = sysDrive; this->InstallPath += "/Program Files"; } else { |