From 84db9ee590d6af695976216f3f41f5a71fb53bac Mon Sep 17 00:00:00 2001 From: Ben Boeckel <mathstuf@gmail.com> Date: Tue, 11 Mar 2014 13:22:50 -0400 Subject: [PATCH] SystemTools: Take strings in AddTranslationPath The arguments are turned into strings right away. Change-Id: I9dfdc37f2317270da2878632d8e02142a641beda --- SystemTools.cxx | 10 +++++----- SystemTools.hxx.in | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/SystemTools.cxx b/SystemTools.cxx index 2eff35f..4e412e3 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 c0f3d30..644f498 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, -- GitLab