returning #<eof> for end of input on read-u8

This commit is contained in:
Alex Shinn 2012-07-16 17:37:47 +09:00
parent 6de7d5621d
commit 582a3295d4

View file

@ -366,7 +366,7 @@ sexp sexp_read_u8 (sexp ctx, sexp self, sexp in) {
} }
#endif #endif
if (c == '\n') sexp_port_line(in)++; if (c == '\n') sexp_port_line(in)++;
return sexp_make_fixnum(c); return (c==EOF) ? SEXP_EOF : sexp_make_fixnum(c);
} }
sexp sexp_peek_u8 (sexp ctx, sexp self, sexp in) { sexp sexp_peek_u8 (sexp ctx, sexp self, sexp in) {