1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 11:40:18 +02:00

%port-encoding requires an open port

* libguile/ports.c (scm_sys_port_encoding)
  (scm_sys_set_port_encoding_x): Require an open port, to match 2.0
  behavior.
This commit is contained in:
Andy Wingo 2017-03-01 19:52:17 +01:00
parent b56b944920
commit 25652ff84c

View file

@ -1211,7 +1211,7 @@ SCM_DEFINE (scm_sys_port_encoding, "%port-encoding", 1, 0, 0,
"uses to interpret its input and output.\n")
#define FUNC_NAME s_scm_sys_port_encoding
{
SCM_VALIDATE_PORT (1, port);
SCM_VALIDATE_OPPORT (1, port);
return SCM_PORT (port)->encoding;
}
@ -1232,7 +1232,7 @@ SCM_DEFINE (scm_sys_set_port_encoding_x, "%set-port-encoding!", 2, 0, 0,
"and this procedure can be used to modify that encoding.\n")
#define FUNC_NAME s_scm_sys_set_port_encoding_x
{
SCM_VALIDATE_PORT (1, port);
SCM_VALIDATE_OPPORT (1, port);
SCM_VALIDATE_SYMBOL (2, enc);
scm_i_set_port_encoding_x (port, scm_i_symbol_chars (enc));