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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 18536 in the body.
You can then email your comments to 18536 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guile <at> gnu.org:
bug#18536; Package guile. (Tue, 23 Sep 2014 15:15:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to David Kastrup <dak <at> gnu.org>:
New bug report received and forwarded. Copy sent to bug-guile <at> gnu.org. (Tue, 23 Sep 2014 15:15:04 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

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





Reply sent to Mark H Weaver <mhw <at> netris.org>:
You have taken responsibility. (Wed, 24 Sep 2014 01:47:02 GMT) Full text and rfc822 format available.

Notification sent to David Kastrup <dak <at> gnu.org>:
bug acknowledged by developer. (Wed, 24 Sep 2014 01:47:03 GMT) Full text and rfc822 format available.

Message #10 received at 18536-done <at> debbugs.gnu.org (full text, mbox):

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




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 22 Oct 2014 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 182 days ago.

Previous Next


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