summaryrefslogtreecommitdiffstats
path: root/Source/kwsys
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2005-04-26 15:31:08 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2005-04-26 15:31:08 (GMT)
commitd381fbfa380cc419c2e967e948f8d908020a273c (patch)
treed51079350d3ba2049d3abb1550c365e3bdc20135 /Source/kwsys
parent3db6752efbe34cd15a749fa036840dcecdd22bd6 (diff)
downloadCMake-d381fbfa380cc419c2e967e948f8d908020a273c.zip
CMake-d381fbfa380cc419c2e967e948f8d908020a273c.tar.gz
CMake-d381fbfa380cc419c2e967e948f8d908020a273c.tar.bz2
BUG: Looks like std::string changes the result of c_str() call. This fixes potential problems
Diffstat (limited to 'Source/kwsys')
-rw-r--r--Source/kwsys/SystemTools.cxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index f1b59ba..7678601 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -1222,6 +1222,7 @@ void SystemTools::ConvertToUnixSlashes(kwsys_stl::string& path)
if(!path.empty())
{
// if there is a tilda ~ then replace it with HOME
+ pathCString = path.c_str();
if(*pathCString == '~')
{
const char* homeEnv = SystemTools::GetEnv("HOME");
@@ -1231,6 +1232,7 @@ void SystemTools::ConvertToUnixSlashes(kwsys_stl::string& path)
}
}
+ pathCString = path.c_str();
if (*(pathCString+(path.size()-1)) == '/')
{
path = path.substr(0, path.size()-1);