ERR: Verify that getenv returned something before using it
This commit is contained in:
parent
84a1d5e553
commit
161c31bc2b
|
@ -169,7 +169,14 @@ void SystemTools::GetPath(kwsys_stl::vector<kwsys_stl::string>& path, const char
|
||||||
{
|
{
|
||||||
env = "PATH";
|
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.
|
// A hack to make the below algorithm work.
|
||||||
if(pathEnv[pathEnv.length()-1] != ':')
|
if(pathEnv[pathEnv.length()-1] != ':')
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue