Skip to content

Commit 33a704e

Browse files
committed
Fix macro expansion: no more % abandoned by the end of variable
1 parent 5728110 commit 33a704e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/macro_expansion.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@ std::string MacroExpansion::expand(const std::string& input,
6262
variableValue = transaction->m_collections.resolveFirst(col, var);
6363
}
6464

65-
if (res[end - start + 2] == '%') {
66-
res.erase(start, end - start + 1);
67-
} else {
68-
res.erase(start, end - start + 2);
65+
res.erase(start, end - start + 1);
66+
if (res[start] == '%') {
67+
res.erase(start, 1);
6968
}
69+
7070
if (variableValue != NULL) {
7171
res.insert(start, *variableValue);
7272
}

0 commit comments

Comments
 (0)