From 161c31bc2b282cb168944df85755ff1373c5f8f7 Mon Sep 17 00:00:00 2001 From: Andy Cedilnik Date: Thu, 22 Apr 2004 14:11:25 -0400 Subject: ERR: Verify that getenv returned something before using it --- Source/kwsys/SystemTools.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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& 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] != ':') { -- cgit v0.12