diff --git a/src/modal.c b/src/modal.c index ba9a1c5..ff780b3 100644 --- a/src/modal.c +++ b/src/modal.c @@ -136,9 +136,9 @@ commit_rule(Rule *r, char *s, int create) } static int -write_rule(Rule *r, char last, char *res) +write_rule(Rule *r, char *res) { - char c, *b = r->b, *origin = dst_; + char c, last = 0, *b = r->b, *origin = dst_; while((c = *b++)) if(c == '?' && last != '\\' && regs[(int)*b]) put_reg(*b++); @@ -197,11 +197,11 @@ rewrite(void) create_rule(&lambda, -1, s), s = cap; while((c = *s) && c <= ' ') s++; if((res = match_rule(&lambda, s)) != NULL) - return write_rule(&lambda, last, res); + return write_rule(&lambda, res); } for(r = rules; r < rules_; r++) if((res = match_rule(r, s)) != NULL) - return write_rule(r, last, res); + return write_rule(r, res); } *dst_++ = last = c; s++;