From 4798fe53a535d12bc0778c57b8aa6d6925b98eca Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Sun, 7 Apr 2024 15:32:53 -0700 Subject: [PATCH] Added basic compression on input --- src/modal.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/modal.c b/src/modal.c index 34ea05e..34d2800 100644 --- a/src/modal.c +++ b/src/modal.c @@ -226,10 +226,8 @@ main(int argc, char **argv) return !printf("Invalid Modal file: %s.\n", argv[1]); while(fread(&c, 1, 1, f)) { if(w > bank_a) { - /* if(c == ')' && *(w - 1) == ' ') w--; */ - /* if(c == '(' && *(w - 1) == ' ') w--; */ - /* if(c == ' ' && *(w - 1) == '(') continue; */ - /* if(c == ' ' && *(w - 1) == ')') continue; */ + if(c == ' ' && *(w - 1) == '(') continue; + if(c == ')' && *(w - 1) == ' ') w--; if(c == ' ' && *(w - 1) == ' ') w--; } *w++ = c;