From ffe9413259245856c777bf590bc86f547c0efed5 Mon Sep 17 00:00:00 2001 From: Ben Boeckel <ben.boeckel@kitware.com> Date: Thu, 24 Jul 2014 12:52:57 -0400 Subject: [PATCH] SystemTools: use char instead of const char* Everything is one character anyways, remove the level of indirection. Change-Id: I26a59acc4778b93ed68de098e5640c7835d5ee43 --- SystemTools.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SystemTools.cxx b/SystemTools.cxx index 343acf2..7c48f39 100644 --- a/SystemTools.cxx +++ b/SystemTools.cxx @@ -334,9 +334,9 @@ class SystemToolsTranslationMap : void SystemTools::GetPath(kwsys_stl::vector<kwsys_stl::string>& path, const char* env) { #if defined(_WIN32) && !defined(__CYGWIN__) - const char* pathSep = ";"; + const char pathSep = ';'; #else - const char* pathSep = ":"; + const char pathSep = ':'; #endif if(!env) { @@ -351,7 +351,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.empty() && pathEnv[pathEnv.length()-1] != pathSep[0]) + if(!pathEnv.empty() && *pathEnv.rbegin() != pathSep) { pathEnv += pathSep; } -- GitLab