mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2025-12-06 02:40:26 -08:00
streams: bivalent stream signals a condition for bytes out of range
Sometimes a byte may be not within the character code range. In that case, when we read the char, the system will signal a condition. Alternatively (and that's the behavior before this commit) we could return the character #\Nul. That was done by virtue of ECL_CHAR_CODE skipping tag bytes, so the returned NIL was treated as 0.
This commit is contained in:
parent
43fef5fad8
commit
41f52d8d0f
1 changed files with 3 additions and 1 deletions
|
|
@ -157,7 +157,9 @@ char_byte(cl_object byte)
|
|||
unlikely_if (byte != OBJNULL && Null(cl_integerp(byte))) {
|
||||
FEwrong_type_argument(@[byte], byte);
|
||||
}
|
||||
return byte == OBJNULL ? EOF : ECL_CHAR_CODE(cl_code_char(byte));
|
||||
/* INV cl_code_char can return NIL for bytes outside of the char range.
|
||||
ecl_char_code will signal a condition then. */
|
||||
return byte == OBJNULL ? EOF : ecl_char_code(cl_code_char(byte));
|
||||
}
|
||||
|
||||
static ecl_character
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue