Skip to content

Commit 9a2f653

Browse files
committed
Don't special case unknown errors.
If there is any I/O error, result of input is already undefined.
1 parent 22af491 commit 9a2f653

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

src/interp/input.asm

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,15 @@ line_buf = LBUFF
5555

5656
sty IOERROR
5757
sta line_buf - 1 ; Assume that this location is available
58-
beq no_eol ; EOF
58+
beq no_eol ; No characters read
59+
; Error 136: end of file, keep last character
5960
cpy #$88
6061
beq no_eol
61-
tya
62-
bmi no_eol ; TODO: ERROR!?
62+
; TODO: do we need to handle other errors?
63+
; tya
64+
; bmi no_eol
65+
66+
; Remove EOL at end of buffer
6367
dec line_buf - 1
6468
no_eol:
6569
lda #<(line_buf-1)

0 commit comments

Comments
 (0)