1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 03:40:34 +02:00

Fix ungetc for characters 0x80 <= c < 0xf0 in UTF-8.

Fixes <http://bugs.gnu.org/18536>.

* libguile/ports.c (scm_ungetc_unlocked): Fix bad UTF-8 reencoding,
  introduced in commit be7ecef05c.

Signed-off-by: David Kastrup <dak@gnu.org>
This commit is contained in:
David Kastrup 2014-09-23 21:39:29 -04:00 committed by Mark H Weaver
parent c5ea75534c
commit f7582f9807

View file

@ -2139,7 +2139,7 @@ scm_ungetc_unlocked (scm_t_wchar c, SCM port)
if (pti->encoding_mode == SCM_PORT_ENCODING_MODE_UTF8) if (pti->encoding_mode == SCM_PORT_ENCODING_MODE_UTF8)
{ {
if (c < 0xf0) if (c < 0x80)
{ {
result_buf[0] = (char) c; result_buf[0] = (char) c;
result = result_buf; result = result_buf;