diff --git a/src/plugins/guile/weechat-guile-api.c b/src/plugins/guile/weechat-guile-api.c index d35beba86..ebe32dbab 100644 --- a/src/plugins/guile/weechat-guile-api.c +++ b/src/plugins/guile/weechat-guile-api.c @@ -4974,7 +4974,9 @@ weechat_guile_api_module_init (void *data) port_type = scm_make_port_type ("weechat_stdout", &weechat_guile_port_fill_input, &weechat_guile_port_write); - guile_port = scm_c_make_port (port_type, 0, 0); + guile_port = scm_c_make_port (port_type, SCM_WRTNG | SCM_BUF0, 0); + scm_set_current_output_port (guile_port); + scm_set_current_error_port (guile_port); #else /* Guile < 2.2 */ scm_t_bits port_type; diff --git a/src/plugins/guile/weechat-guile.c b/src/plugins/guile/weechat-guile.c index 24bedb541..ea1b3a77b 100644 --- a/src/plugins/guile/weechat-guile.c +++ b/src/plugins/guile/weechat-guile.c @@ -1151,11 +1151,10 @@ weechat_guile_port_fill_input (SCM port, SCM dst, size_t start, size_t count) { /* make C compiler happy */ (void) port; - (void) dst; - (void) start; - (void) count; - return ' '; + memset (SCM_BYTEVECTOR_CONTENTS (dst) + start, ' ', count); + + return count; } #else /* Guile < 2.2 */ @@ -1184,7 +1183,7 @@ weechat_guile_port_write (SCM port, SCM src, size_t start, size_t count) /* make C compiler happy */ (void) port; - data = scm_to_locale_string (src); + data = SCM_BYTEVECTOR_CONTENTS (src); data2 = malloc (count + 1); if (!data2)