From: Mark H Weaver Date: Wed, 1 May 2019 09:20:36 +0000 (-0400) Subject: put-u8: Always write a single byte, regardless of the port encoding. X-Git-Tag: v2.9.2~2^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=91b5b1631f87067a63cb0b50df5dbfce977c18c7;p=platform%2Fupstream%2Fguile.git put-u8: Always write a single byte, regardless of the port encoding. Previously, 'put-u8' used textual I/O to write a single character, relying on the usual practice of setting the port encoding to ISO-8859-1 for binary ports. * libguile/r6rs-ports.c (scm_put_u8): Use 'scm_c_write', not 'scm_putc'. --- diff --git a/libguile/r6rs-ports.c b/libguile/r6rs-ports.c index c1cbbdf30..16c148090 100644 --- a/libguile/r6rs-ports.c +++ b/libguile/r6rs-ports.c @@ -570,7 +570,7 @@ SCM_DEFINE (scm_put_u8, "put-u8", 2, 0, 0, SCM_VALIDATE_BINARY_OUTPUT_PORT (1, port); c_octet = scm_to_uint8 (octet); - scm_putc ((char) c_octet, port); + scm_c_write (port, &c_octet, 1); return SCM_UNSPECIFIED; }