From d381fbfa380cc419c2e967e948f8d908020a273c Mon Sep 17 00:00:00 2001 From: Andy Cedilnik Date: Tue, 26 Apr 2005 11:31:08 -0400 Subject: [PATCH] BUG: Looks like std::string changes the result of c_str() call. This fixes potential problems --- Source/kwsys/SystemTools.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx index f1b59ba927..7678601b00 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);