diff options
author | Rolf Eike Beer <eike@sf-mail.de> | 2020-03-20 13:29:30 (GMT) |
---|---|---|
committer | Rolf Eike Beer <eike@sf-mail.de> | 2020-03-23 19:19:26 (GMT) |
commit | 7df84ffe58572a4535b08bc7b76148a60d38fbb4 (patch) | |
tree | bc57bd409d140f969ad2bdbe5c14a8b173d308ef /Source/cmCTest.cxx | |
parent | d6a4e9fbc8009861108923a529c3a36998682baa (diff) | |
download | CMake-7df84ffe58572a4535b08bc7b76148a60d38fbb4.zip CMake-7df84ffe58572a4535b08bc7b76148a60d38fbb4.tar.gz CMake-7df84ffe58572a4535b08bc7b76148a60d38fbb4.tar.bz2 |
allow cmCTest::CleanString() to skip input characters
This entirely avoids that one needs to call std::string::substr() for the
input.
Diffstat (limited to 'Source/cmCTest.cxx')
-rw-r--r-- | Source/cmCTest.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 157d315..28c12a4 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -271,9 +271,10 @@ bool cmCTest::GetTomorrowTag() const return this->Impl->TomorrowTag; } -std::string cmCTest::CleanString(const std::string& str) +std::string cmCTest::CleanString(const std::string& str, + std::string::size_type spos) { - std::string::size_type spos = str.find_first_not_of(" \n\t\r\f\v"); + spos = str.find_first_not_of(" \n\t\r\f\v", spos); std::string::size_type epos = str.find_last_not_of(" \n\t\r\f\v"); if (spos == std::string::npos) { return std::string(); @@ -738,7 +739,7 @@ bool cmCTest::UpdateCTestConfiguration() continue; } std::string key = line.substr(0, cpos); - std::string value = cmCTest::CleanString(line.substr(cpos + 1)); + std::string value = cmCTest::CleanString(line, cpos + 1); this->Impl->CTestConfiguration[key] = value; } fin.close(); |