diff options
author | Petr Kmoch <petr.kmoch@gmail.com> | 2013-03-27 07:35:27 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-03-27 12:46:55 (GMT) |
commit | 674f918a1afbf1808328bac944aa8944f2475fe9 (patch) | |
tree | e34bcc811cf2712ffbb8fe87f03f524c57055b1c /Source/cmSystemTools.cxx | |
parent | b9e4a5abb45055b310032977a9542acff3c14c9b (diff) | |
download | CMake-674f918a1afbf1808328bac944aa8944f2475fe9.zip CMake-674f918a1afbf1808328bac944aa8944f2475fe9.tar.gz CMake-674f918a1afbf1808328bac944aa8944f2475fe9.tar.bz2 |
cmSystemTools: Generalize TrimWhitespace to all whitespace
Modify cmSystemTools::TrimWhitespace() to remove all leading and
trailing whitespace, not just spaces.
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r-- | Source/cmSystemTools.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 525efb4..67f3023 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -203,13 +203,13 @@ std::string cmSystemTools::EscapeQuotes(const char* str) std::string cmSystemTools::TrimWhitespace(const std::string& s) { std::string::const_iterator start = s.begin(); - while(start != s.end() && *start == ' ') + while(start != s.end() && *start <= ' ') ++start; if (start == s.end()) return ""; std::string::const_iterator stop = s.end()-1; - while(*stop == ' ') + while(*stop <= ' ') --stop; return std::string(start, stop+1); } |