Skip to content
Snippets Groups Projects
Commit f0860b5b authored by Andy Cedilnik's avatar Andy Cedilnik
Browse files

ERR: Verify that getenv returned something before using it

parent 953f9c71
No related branches found
No related tags found
No related merge requests found
......@@ -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] != ':')
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment