diff --git a/src/modal.c b/src/modal.c index fd5e6e5..70f07bc 100644 --- a/src/modal.c +++ b/src/modal.c @@ -84,6 +84,7 @@ put_reg(char r) case 't': putc(0x09, stdout); break; case 'n': putc(0x0a, stdout); break; case 's': putc(0x20, stdout); break; + case '?': putc(0x3f, stdout); break; } } else putc(c, stdout); @@ -103,7 +104,7 @@ match_rule(Rule *r, char *p) rmin = 0xff, rmax = 0x00; } while((c = *a)) { - if(spacer(last) && c == '?') { + if(c == '?' && last != '\\') { if(!set_reg(*(++a), b)) return NULL; a++, b = walk(b); continue; @@ -137,7 +138,7 @@ write_rule(Rule *r, char last, char *res) { char c, *b = r->b, *origin = dst_; while((c = *b++)) - if(spacer(last) && c == '?' && regs[(int)*b]) + if(c == '?' && last != '\\' && regs[(int)*b]) put_reg(*b++); else *dst_++ = c, last = c;