diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2004-04-22 18:11:25 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2004-04-22 18:11:25 (GMT) |
commit | 161c31bc2b282cb168944df85755ff1373c5f8f7 (patch) | |
tree | d443cf1ff5dbb032408ba99f95691502e3b3e27c | |
parent | 84a1d5e55368f952277dc4aeab792a94a39fd146 (diff) | |
download | CMake-161c31bc2b282cb168944df85755ff1373c5f8f7.zip CMake-161c31bc2b282cb168944df85755ff1373c5f8f7.tar.gz CMake-161c31bc2b282cb168944df85755ff1373c5f8f7.tar.bz2 |
ERR: Verify that getenv returned something before using it
-rw-r--r-- | Source/kwsys/SystemTools.cxx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx index b7ad66b..63256fc 100644 --- a/Source/kwsys/SystemTools.cxx +++ b/Source/kwsys/SystemTools.cxx @@ -169,7 +169,14 @@ void SystemTools::GetPath(kwsys_stl::vector<kwsys_stl::string>& path, const char { env = "PATH"; } - kwsys_stl::string pathEnv = getenv(env); + const char* cpathEnv = SystemTools::GetEnv(env); + if ( !cpathEnv ) + { + return; + } + + kwsys_stl::string pathEnv = cpathEnv; + // A hack to make the below algorithm work. if(pathEnv[pathEnv.length()-1] != ':') { |