diff --git a/SystemTools.cxx b/SystemTools.cxx index 2eff35fcf7a35c67a0586dfca7ff7ee550b16ee9..4e412e300b1ec4864d5ced3169034563854dd352 100644 --- a/SystemTools.cxx +++ b/SystemTools.cxx @@ -3051,7 +3051,7 @@ kwsys_stl::string SystemTools::CollapseFullPath(const char* in_relative) return SystemTools::CollapseFullPath(in_relative, 0); } -void SystemTools::AddTranslationPath(const char * a, const char * b) +void SystemTools::AddTranslationPath(const kwsys_stl::string& a, const kwsys_stl::string& b) { kwsys_stl::string path_a = a; kwsys_stl::string path_b = b; @@ -3089,7 +3089,7 @@ void SystemTools::AddKeepPath(const char* dir) { kwsys_stl::string cdir; Realpath(SystemTools::CollapseFullPath(dir).c_str(), cdir); - SystemTools::AddTranslationPath(cdir.c_str(), dir); + SystemTools::AddTranslationPath(cdir, dir); } void SystemTools::CheckTranslationPath(kwsys_stl::string & path) @@ -3207,7 +3207,7 @@ kwsys_stl::string SystemTools::CollapseFullPath(const char* in_path, // collapsed, so I am going to try to comment it out, and see what hits the // fan, hopefully quickly. // Commented out line below: - //SystemTools::AddTranslationPath(newPath.c_str(), in_path); + //SystemTools::AddTranslationPath(newPath, in_path); SystemTools::CheckTranslationPath(newPath); #ifdef _WIN32 @@ -4917,8 +4917,8 @@ void SystemTools::ClassInitialize() // Add the translation to keep the logical path name. if(!cwd_changed.empty() && !pwd_changed.empty()) { - SystemTools::AddTranslationPath(cwd_changed.c_str(), - pwd_changed.c_str()); + SystemTools::AddTranslationPath(cwd_changed, + pwd_changed); } } } diff --git a/SystemTools.hxx.in b/SystemTools.hxx.in index c0f3d30629ba6fa952f30f0c07d197e0ea7608d5..644f49881cb7158f594956d8ddf5f37688443193 100644 --- a/SystemTools.hxx.in +++ b/SystemTools.hxx.in @@ -806,7 +806,7 @@ public: /** * Add an entry in the path translation table. */ - static void AddTranslationPath(const char * dir, const char * refdir); + static void AddTranslationPath(const kwsys_stl::string& dir, const kwsys_stl::string& refdir); /** * If dir is different after CollapseFullPath is called,