summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Source/kwsys/SystemTools.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index ed7f62c0a3..4d83293d97 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -326,7 +326,7 @@ void SystemTools::GetPath(kwsys_stl::vector<kwsys_stl::string>& path, const char
kwsys_stl::string pathEnv = cpathEnv;
// A hack to make the below algorithm work.
- if(pathEnv[pathEnv.length()-1] != ':')
+ if(!pathEnv.empty() && pathEnv[pathEnv.length()-1] != pathSep[0])
{
pathEnv += pathSep;
}