Actually trim whitespace when combining lines

regex_replace does not mutate the string in place.
This commit is contained in:
Thomas Goyne 2013-09-21 11:21:21 -07:00
parent e315ceb236
commit 8fade74026

View file

@ -863,8 +863,8 @@ std::string trim_text(std::string text) {
boost::regex start("^( |\t|\\\\[nNh])+");
boost::regex end("( |\t|\\\\[nNh])+$");
regex_replace(text, start, "", boost::format_first_only);
regex_replace(text, end, "", boost::format_first_only);
text = regex_replace(text, start, "", boost::format_first_only);
text = regex_replace(text, end, "", boost::format_first_only);
return text;
}