Fix invalid character in bracketed macro argument

The invalid character should not be consumed by `shiftChar()`.
This commit is contained in:
Rangi42
2026-04-27 16:57:54 +02:00
parent c1c7e64249
commit 9fd0c0297f
7 changed files with 20 additions and 6 deletions
+4 -2
View File
@@ -582,11 +582,13 @@ static uint32_t readBracketedMacroArgNum() {
empty = true;
}
c = bumpChar();
c = peek();
if (c != '>') {
error("Invalid character %s in bracketed macro argument", printChar(c));
return 0;
} else if (empty) {
}
shiftChar();
if (empty) {
error("Empty bracketed macro argument");
return 0;
} else if (num == 0 && !symbolError) {