From a890215143e058d02c69457d564ac533f0b02157 Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Thu, 11 Apr 2024 10:02:53 -0700 Subject: [PATCH] Simpler plode --- src/modal.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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))