GNU bug report logs - #18536
[PATCH] Fix unread-string for characters 0x80 <= c < 0xf0 in UTF-8

Previous Next

Package: guile;

Reported by: David Kastrup <dak <at> gnu.org>

Date: Tue, 23 Sep 2014 15:15:03 UTC

Severity: normal

Tags: patch

Done: Mark H Weaver <mhw <at> netris.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: David Kastrup <dak <at> gnu.org>
Subject: bug#18536: closed (Re: bug#18536: [PATCH] Fix unread-string for
 characters 0x80 <= c < 0xf0 in UTF-8)
Date: Wed, 24 Sep 2014 01:47:03 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#18536: [PATCH] Fix unread-string for characters 0x80 <= c < 0xf0 in UTF-8

which was filed against the guile package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 18536 <at> debbugs.gnu.org.

-- 
18536: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18536
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Mark H Weaver <mhw <at> netris.org>
To: David Kastrup <dak <at> gnu.org>
Cc: 18536-done <at> debbugs.gnu.org
Subject: Re: bug#18536: [PATCH] Fix unread-string for characters 0x80 <= c <
 0xf0 in UTF-8
Date: Tue, 23 Sep 2014 21:44:38 -0400
Pushed to master, commit f7582f9807d9a10fba86f54c4aeaa7444c51a315.
I'm closing this bug now.

     Thanks,
       Mark

[Message part 3 (message/rfc822, inline)]
From: David Kastrup <dak <at> gnu.org>
To: bug-guile <at> gnu.org
Cc: David Kastrup <dak <at> gnu.org>
Subject: [PATCH] Fix unread-string for characters 0x80 <= c < 0xf0 in UTF-8
Date: Tue, 23 Sep 2014 17:10:19 +0200
* libguile/ports.c (scm_ungetc_unlocked): Fix bad reencoding.

The code

(with-input-from-string ""
  (lambda () (unread-string "\"ä\"" (current-input-port)) (read)))

returns "?" instead of "ä".  This bug was introduced in
commit be7ecef05c1eea66f30360f658c610710c5cb22e

Signed-off-by: David Kastrup <dak <at> gnu.org>
---
 libguile/ports.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libguile/ports.c b/libguile/ports.c
index 8185d85..3129282 100644
--- a/libguile/ports.c
+++ b/libguile/ports.c
@@ -2139,7 +2139,7 @@ scm_ungetc_unlocked (scm_t_wchar c, SCM port)
 
   if (pti->encoding_mode == SCM_PORT_ENCODING_MODE_UTF8)
     {
-      if (c < 0xf0)
+      if (c < 0x80)
         {
           result_buf[0] = (char) c;
           result = result_buf;
-- 
1.9.1




This bug report was last modified 10 years and 246 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.