core: current_input_port: Prepare for M2-Planet.

* src/posix.c (current_input_port): Prepare for M2-Planet.
This commit is contained in:
Jan Nieuwenhuizen 2019-10-24 21:31:51 +02:00
parent 831544d353
commit b0b14fc6fe
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
1 changed files with 6 additions and 2 deletions

View File

@ -193,8 +193,12 @@ current_input_port ()
if (__stdin >= 0)
return make_number (__stdin);
SCM x = g_ports;
while (x && PORT (CAR (x)) != __stdin)
x = CDR (x);
while (x)
{
if (PORT (CAR (x)) == __stdin)
return CAR (x);
x = CDR (x);
}
return CAR (x);
}