From 81a995090f64db30cd3115dc5fe82e116d2b444c Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Thu, 4 Apr 2024 14:59:55 -0700 Subject: [PATCH] Housekeeping --- src/modal.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/modal.c b/src/modal.c index 47b6088..b05b764 100644 --- a/src/modal.c +++ b/src/modal.c @@ -1,5 +1,4 @@ #include -#include typedef struct { char *a, *b; @@ -46,8 +45,7 @@ writereg(char r) while((c = *s++)) { if(c == '(') depth++; if(c == ')') --depth; - if(c == ' ' && !depth) - break; + if(c == ' ' && !depth) break; *outp_++ = c; } return 1; @@ -57,8 +55,7 @@ static void save(void) { int i, end = outp_ - outp; - for(i = 0; i < end; i++) - prog[i] = outp[i]; + for(i = 0; i < end; i++) prog[i] = outp[i]; prog[i] = 0; prog_ = prog; outp_ = outp; @@ -76,12 +73,11 @@ rewrite(void) char *res = match(p, r); if(res != NULL) { char cc, *b = r->b; - while((cc = *b++)) { + while((cc = *b++)) if(cc == '?') writereg(*b++); else *outp_++ = cc; - } found = 1; p = res; }