From 971eb4d56e3d3c9bc11acf6082e21d5388d808bb Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Mon, 3 Feb 2014 17:00:21 -0500 Subject: stringapi: Use strings for TryFullPath --- Source/cmSourceFile.cxx | 9 +++++---- Source/cmSourceFile.h | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx index 9feda6c..f052044 100644 --- a/Source/cmSourceFile.cxx +++ b/Source/cmSourceFile.cxx @@ -164,7 +164,7 @@ bool cmSourceFile::FindFullPath(std::string* error) } tryPath += this->Location.GetName(); tryPath = cmSystemTools::CollapseFullPath(tryPath.c_str(), *di); - if(this->TryFullPath(tryPath.c_str(), 0)) + if(this->TryFullPath(tryPath.c_str(), "")) { return true; } @@ -217,10 +217,11 @@ bool cmSourceFile::FindFullPath(std::string* error) } //---------------------------------------------------------------------------- -bool cmSourceFile::TryFullPath(const char* tp, const char* ext) +bool cmSourceFile::TryFullPath(const std::string& path, + const std::string& ext) { - std::string tryPath = tp; - if(ext && *ext) + std::string tryPath = path; + if(!ext.empty()) { tryPath += "."; tryPath += ext; diff --git a/Source/cmSourceFile.h b/Source/cmSourceFile.h index 833a490..b362c98 100644 --- a/Source/cmSourceFile.h +++ b/Source/cmSourceFile.h @@ -107,7 +107,7 @@ private: bool FindFullPathFailed; bool FindFullPath(std::string* error); - bool TryFullPath(const char* tryPath, const char* ext); + bool TryFullPath(const std::string& path, const std::string& ext); void CheckExtension(); void CheckLanguage(std::string const& ext); -- cgit v0.12