From dfbb9c4fac99699a2ec9a2f27203bb181f1e2c21 Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Fri, 12 Apr 2024 09:45:53 -0700 Subject: [PATCH] Only test for registers following a spacer --- src/modal.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modal.c b/src/modal.c index fa9c848..5004d94 100644 --- a/src/modal.c +++ b/src/modal.c @@ -98,17 +98,17 @@ static char * match_rule(Rule *r, char *p) { int i; - char c, *a = r->a, *b = p; + char c, last = 0, *a = r->a, *b = p; for(i = 0x21; i < 0x7f; i++) regs[i] = 0; while((c = *a)) { - if(c == '?') { + if(spacer(last) && c == '?') { if(!set_reg(*(++a), b)) return NULL; a++, b = walk(b); continue; } if(*a != *b) return NULL; - a++, b++; + a++, b++, last = c; } c = *b; return spacer(c) ? b : NULL;