Merge topic 'SystemTools-TrimWhitespace-all'

674f918 cmSystemTools: Generalize TrimWhitespace to all whitespace
This commit is contained in:
Brad King 2013-03-28 10:43:22 -04:00 committed by CMake Topic Stage
commit 1f16bd24ee
1 changed files with 2 additions and 2 deletions

View File

@ -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);
}