fixed problem with special characters being stripped off strings
This commit is contained in:
parent
27b6a10d29
commit
f715e79865
1 changed files with 5 additions and 1 deletions
|
@ -621,11 +621,15 @@ std::vector<std::string> config::split(const std::string& val)
|
|||
return res;
|
||||
}
|
||||
|
||||
namespace {
|
||||
bool notspace(char c) { return !isspace(c); }
|
||||
}
|
||||
|
||||
std::string& config::strip(std::string& str)
|
||||
{
|
||||
//if all the string contains is whitespace, then the whitespace may
|
||||
//have meaning, so don't strip it
|
||||
const std::string::iterator it=std::find_if(str.begin(),str.end(),isgraph);
|
||||
const std::string::iterator it=std::find_if(str.begin(),str.end(),notspace);
|
||||
if(it == str.end())
|
||||
return str;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue