|
|
@ -297,10 +297,23 @@ Attachment::Attachment (ifstream &mbox, const int &level, const streamoff beginI |
|
|
|
|
|
|
|
// ================================================================================
|
|
|
|
inline string |
|
|
|
cleanString (const string &line) { |
|
|
|
cleanString (string line) { |
|
|
|
static const regex findVarVal ("(\\s*[a-zA-Z_*-]+=)((\"(\\\\.|[^\\\\])*\")|[^; \t]*;?)"); |
|
|
|
string result; |
|
|
|
smatch m; |
|
|
|
|
|
|
|
while (regex_search (line, m, findVarVal)) { |
|
|
|
result += m.prefix (); |
|
|
|
string id (m[1]); |
|
|
|
toLower (id); |
|
|
|
result += id; |
|
|
|
result += m[2]; |
|
|
|
line = m.suffix (); |
|
|
|
} |
|
|
|
if (!line.empty () && line[line.size() - 1] == '\r') |
|
|
|
return line.substr (0, line.size () - 1); |
|
|
|
return line; |
|
|
|
line = line.substr (0, line.size () - 1); |
|
|
|
result += line; |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
void |
|
|
|