Bug in trim prevented parsing gmail dump mbox format
This commit is contained in:
parent
5d8a66884a
commit
33f7d609dc
@ -491,7 +491,9 @@ void trimstring(string& s, const char *ws)
|
|||||||
void rtrimstring(string& s, const char *ws)
|
void rtrimstring(string& s, const char *ws)
|
||||||
{
|
{
|
||||||
string::size_type pos = s.find_last_not_of(ws);
|
string::size_type pos = s.find_last_not_of(ws);
|
||||||
if (pos != string::npos && pos != s.length() - 1) {
|
if (pos == string::npos) {
|
||||||
|
s.clear();
|
||||||
|
} else if (pos != s.length() - 1) {
|
||||||
s.replace(pos + 1, string::npos, string());
|
s.replace(pos + 1, string::npos, string());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user