core: Fix unreadchar on string port when unreading EOF.
* src/posix.c (unreadchar): Fix on string port when unreading EOF.
This commit is contained in:
parent
449f3c7e00
commit
3b312ca983
|
@ -71,6 +71,8 @@ unreadchar (int c)
|
||||||
{
|
{
|
||||||
if (__stdin >= 0)
|
if (__stdin >= 0)
|
||||||
return fdungetc (c, __stdin);
|
return fdungetc (c, __stdin);
|
||||||
|
if (c == EOF) // can't unread EOF
|
||||||
|
return c;
|
||||||
SCM port = current_input_port ();
|
SCM port = current_input_port ();
|
||||||
SCM string = STRING (port);
|
SCM string = STRING (port);
|
||||||
size_t length = LENGTH (string);
|
size_t length = LENGTH (string);
|
||||||
|
|
Loading…
Reference in a new issue