From 7a124eb70f0731cb5d77e29dbf953ff2c3b767df Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Sat, 20 Apr 2024 22:31:58 -0700 Subject: [PATCH] Do not pass last to write_rule --- src/modal.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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++;