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;