diff --git a/src/modal.c b/src/modal.c index ec31827..560d51a 100644 --- a/src/modal.c +++ b/src/modal.c @@ -34,13 +34,12 @@ static char * plode(char *s) { int i, depth = 0; - char c; + char c, *ss; if(s[0] == '(') { /* implode */ - while((c = *s++)) { - if(c == '(') depth++; + ss = walk(s); + while(s < ss) { + c = *(s++); if(!spacer(c)) *outp_++ = c; - if(c == ')') --depth; - if(!depth) return s; } } else { /* explode */ while((c = *s++) && !spacer(c))