Fix captures beginning in expansions

Fixes #590
This commit is contained in:
ISSOtm
2020-12-09 09:54:55 +01:00
parent c3ccdc548e
commit f16e34b804
4 changed files with 5 additions and 3 deletions

View File

@@ -1962,13 +1962,11 @@ restart:
static char *startCapture(void)
{
assert(!lexerState->expansions);
lexerState->capturing = true;
lexerState->captureSize = 0;
lexerState->disableMacroArgs = true;
if (lexerState->isMmapped) {
if (lexerState->isMmapped && !lexerState->expansions) {
return &lexerState->ptr[lexerState->offset];
} else {
lexerState->captureCapacity = 128; /* The initial size will be twice that */