diff --git a/src/CHANGELOG b/src/CHANGELOG index 1478aba70..239204353 100644 --- a/src/CHANGELOG +++ b/src/CHANGELOG @@ -200,7 +200,7 @@ ECL 8.9.0: - Hash tables were not properly serialized. - - WRITE/READ-LINE did not work with gray streams (A. Vodonosov) + - WRITE/READ-LINE and READ-BYTE did not work with gray streams (A. Vodonosov) - When working with Gray streams, READ-LINE did not handle the EOF properly. diff --git a/src/c/file.d b/src/c/file.d index 28eab6207..a869998d7 100644 --- a/src/c/file.d +++ b/src/c/file.d @@ -994,7 +994,11 @@ ecl_read_byte(cl_object strm) BEGIN: #ifdef ECL_CLOS_STREAMS if (ECL_INSTANCEP(strm)) { - return funcall(2, @'gray::stream-read-byte', strm); + cl_object b = funcall(2, @'gray::stream-read-byte', strm); + if (FIXNUMP(b) || type_of(b) == t_bignum) { + return b; + } + return Cnil; } #endif if (type_of(strm) != t_stream)