diff --git a/examples/test.modal b/examples/test.modal index 8996d78..bf84ae8 100644 --- a/examples/test.modal +++ b/examples/test.modal @@ -13,4 +13,7 @@ <> (?x ?y swap) (?y ?x) <> (?x pop) () -(implode reverse (explode hello)) (read) (explode hello) empty-register (eq abc abc) (eq abc def) (1 2 3) (4 5 6) swap pop dup (hey 1234 pop) \ No newline at end of file +(implode reverse (explode hello)) (read) (explode hello) empty-register (eq abc abc) (eq abc def) (1 2 3) (4 5 6) swap pop dup (hey 1234 pop) + + + diff --git a/src/modal.c b/src/modal.c index 58f19f2..f17dc9a 100644 --- a/src/modal.c +++ b/src/modal.c @@ -205,7 +205,7 @@ main(int argc, char **argv) } *w++ = c; } - *w++ = 0; + while(*(--w) <= ' ') *w = 0; fclose(f); regs[':'] = argv[2]; while(rewrite())