Browse Source

cmSystemTools: Generalize TrimWhitespace to all whitespace

Modify cmSystemTools::TrimWhitespace() to remove all leading and
trailing whitespace, not just spaces.
Petr Kmoch 12 years ago
parent
commit
674f918a1a
1 changed files with 2 additions and 2 deletions
  1. 2 2
      Source/cmSystemTools.cxx

+ 2 - 2
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);
 }