diff --git a/src/modal.c b/src/modal.c index 8bd4db2..0db8882 100644 --- a/src/modal.c +++ b/src/modal.c @@ -146,8 +146,10 @@ write_rule(Rule *r, char last, char *res) put_reg(*b++); else *dst_++ = c, last = c; - if(dst_ == origin) + if(dst_ == origin) { + if(*res == ')') dst_--; while(*res == ' ') res++; + } return commit_rule(r, res, 0); }