core: current_input_port: Prepare for M2-Planet.

* src/posix.c (current_input_port): Prepare for M2-Planet.
This commit is contained in:
Jan (janneke) Nieuwenhuizen 2020-07-16 21:31:51 +02:00
parent 752c5f7d1b
commit 285d04043f
No known key found for this signature in database
GPG key ID: F3C1A0D9C1D65273

View file

@ -197,8 +197,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);
}