Skip to content

Commit 149d6c6

Browse files
committed
Properly expand multiple variables in the same line.
When were two or more different variables in the same line, ruleparser used to expand the first one and replace *all* variables (since all variables are matches of variableLine regexp) with that expanded value. The corrent way is to replace that exact variable reference with the expanded value.
1 parent 2536659 commit 149d6c6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ruleparser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ void Rules::load(const QString &filename)
188188
qFatal("Undeclared variable: %s", qPrintable(variableLine.cap(1)));
189189
}
190190
}
191-
line = line.replace(variableLine, replacement);
191+
line = line.replace(variableLine.cap(0), replacement);
192192
}
193193
if (state == ReadingRepository) {
194194
if (matchBranchLine.exactMatch(line)) {

0 commit comments

Comments
 (0)