From 8431ac66f69cabd8e6196564358c4d9d543b1fdd Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Fri, 24 May 2024 08:15:59 -0700 Subject: [PATCH] Fixed issue with trailing whitespace --- src/modal.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modal.c b/src/modal.c index 558fb2a..d718473 100644 --- a/src/modal.c +++ b/src/modal.c @@ -115,6 +115,7 @@ file_import(char *path, char *ptr) if(last == ')' && !spacer(c)) *ptr++ = ' '; *ptr++ = last = c; } + while(*(--ptr) <= ' ') *ptr = 0; fclose(f); if(pr) fprintf(stderr, "Modal program imbalanced.\n"); return ptr; @@ -338,7 +339,7 @@ main(int argc, char **argv) return !printf("usage: modal [-vqn] source.modal\n"); for(i = 1; i < argc && *argv[i] == '-'; i++) { switch(argv[i][1]) { - case 'v': /* version */ return !printf("Modal Interpreter, 21 May 2024.\n"); + case 'v': /* version */ return !printf("Modal Interpreter, 24 May 2024.\n"); case 'q': /* quiet */ quiet = 1; break; case 'p': /* debug */ debug = 1; break; case 'a': /* access */ access = 1; break;