Fix macro expansion: no more % abandoned by the end of variable

This commit is contained in:
Felipe Zimmerle 2016-05-06 14:16:37 -03:00
parent 5728110272
commit 33a704e918

View File

@ -62,11 +62,11 @@ std::string MacroExpansion::expand(const std::string& input,
variableValue = transaction->m_collections.resolveFirst(col, var); variableValue = transaction->m_collections.resolveFirst(col, var);
} }
if (res[end - start + 2] == '%') { res.erase(start, end - start + 1);
res.erase(start, end - start + 1); if (res[start] == '%') {
} else { res.erase(start, 1);
res.erase(start, end - start + 2);
} }
if (variableValue != NULL) { if (variableValue != NULL) {
res.insert(start, *variableValue); res.insert(start, *variableValue);
} }