diff --git a/src/modal.c b/src/modal.c index 15d97a2..40c35ce 100644 --- a/src/modal.c +++ b/src/modal.c @@ -132,7 +132,8 @@ write_rule(Rule *r, char last, char *res) put_reg(*b++); else *outp_++ = c, last = c; - if(last == ' ' && outp_ - origin == 0) outp_--; + if(outp_ - origin == 0) + while(*res == ' ') res++; return commit_rule(r, res, 0); } @@ -200,7 +201,7 @@ main(int argc, char **argv) if(argc < 2) return !printf("usage: modal [-v] source.modal\n"); if(argc < 3 && argv[1][0] == '-' && argv[1][1] == 'v') - return !printf("Modal Interpreter, 13 Apr 2024.\n"); + return !printf("Modal Interpreter, 14 Apr 2024.\n"); if(!(f = fopen(argv[1], "r"))) return !printf("Invalid Modal file: %s.\n", argv[1]); while(fread(&c, 1, 1, f)) {