diff --git a/src/modal.c b/src/modal.c index 81ed6ff..77f8666 100644 --- a/src/modal.c +++ b/src/modal.c @@ -104,7 +104,7 @@ match_rule(Rule *r, char *p) rmin = 0xff, rmax = 0x00; } while((c = *a)) { - if(c == '?' && last != '\\') { + if(c == '?' && spacer(last) && spacer(a[2])) { if(!set_reg(*(++a), b)) return NULL; a++, b = walk(b); continue; @@ -138,7 +138,7 @@ write_rule(Rule *r, char last, char *res) { char c, *b = r->b, *origin = dst_; while((c = *b++)) - if(c == '?' && regs[(int)*b] && spacer(last) && spacer(b[1])) + if(c == '?' && last != '\\' && regs[(int)*b]) put_reg(*b++); else *dst_++ = c, last = c;