diff --git a/src/osgDB/XmlParser.cpp b/src/osgDB/XmlParser.cpp index 98cf72dfa..ffde756bb 100644 --- a/src/osgDB/XmlParser.cpp +++ b/src/osgDB/XmlParser.cpp @@ -49,10 +49,12 @@ std::string osgDB::trimEnclosingSpaces(const std::string& str) { if (str.empty()) return str; - std::string::size_type start = str.find_first_not_of(' '); + const std::string whitespaces(" \t\f\v\n\r"); + + std::string::size_type start = str.find_first_not_of(whitespaces); if (start==std::string::npos) return std::string(); - std::string::size_type end = str.find_last_not_of(' '); + std::string::size_type end = str.find_last_not_of(whitespaces); if (end==std::string::npos) return std::string(); return std::string(str, start, (end-start)+1);