Fixed space leak
This commit is contained in:
parent
e04d4fa23f
commit
931d43ea9c
|
@ -2,5 +2,4 @@
|
|||
<> (?: print $) (?:)
|
||||
<> ($ ?x) (?x $)
|
||||
|
||||
$ (Welcome to NAME
|
||||
Have fun!\n\n) print
|
||||
$ (Welcome to NAME \nHave fun!\n\n) print
|
|
@ -40,5 +40,5 @@
|
|||
|
||||
-- (Interface)
|
||||
|
||||
(put-str (Input a move, like "X 0 1":\n))
|
||||
((Input a move, like "X 0 1":\n) put-str)
|
||||
((- - -) (- - -) (- - -)) ready
|
||||
|
|
|
@ -76,11 +76,13 @@ put_reg(char r)
|
|||
} else if(s) {
|
||||
char *ss = walk(s);
|
||||
if(r == ':') {
|
||||
if(*(outp_ - 1) == ' ') outp_--;
|
||||
if(*s == '(') s++, --ss;
|
||||
while(s < ss) {
|
||||
char c = *s++;
|
||||
if(c == '\\') {
|
||||
switch(*s++) {
|
||||
case 't': putc(0x09, stdout); break;
|
||||
case 'n': putc(0x0a, stdout); break;
|
||||
case 's': putc(0x20, stdout); break;
|
||||
}
|
||||
|
@ -209,6 +211,7 @@ main(int argc, char **argv)
|
|||
if(!(f = fopen(argv[1], "r")))
|
||||
return !printf("Invalid Modal file: %s.\n", argv[1]);
|
||||
while(fread(&c, 1, 1, f)) {
|
||||
c = c <= 0x20 ? 0x20 : c;
|
||||
if(w > bank_a) {
|
||||
if(c == ' ' && *(w - 1) == '(') continue;
|
||||
if(c == ')' && *(w - 1) == ' ') w--;
|
||||
|
|
Loading…
Reference in New Issue