bug-texinfo
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GNU info: bug: menu & iso-8859-2 chars problem


From: Eli Zaretskii
Subject: Re: GNU info: bug: menu & iso-8859-2 chars problem
Date: Wed, 9 Jan 2002 14:13:01 +0200 (IST)

On Tue, 8 Jan 2002, Mirsad Todorovac wrote:

> However, to convince yourself, I thought that the best thing might be to
> see for yourself, as I've already done with GPC team and it proved most
> efficient: please log in on
[...]
> - so you could see what really happens on my system, and we could resolve
> this.

Okay, I found the reason: it's a combination of unsafe code in Info with 
an evidently unsafe implementation of the ctype functions in your C 
library.  Info was feeding iscntrl with a negative number whenever there 
was an 8-bit character in the text, and iscntrl was returning non-zero 
for negative arguments.  This confused Info as to how many columns such
characters take up on the screen, and the result was what you observed.

The patch below solves the problem.  (You can install the fixed version of 
Info I built in the directory you set up for me.)

2002-01-09  Eli Zaretskii <address@hidden>

        * info/window.c (calculate_line_starts): Cast node->contents[i] to
        unsigned char.

--- info/window.c~0     Fri Jun 25 23:57:40 1999
+++ info/window.c       Wed Jan  9 13:00:06 2002
@@ -826,7 +826,10 @@ calculate_line_starts (window)
 
       while (1)
         {
-          c = node->contents[i];
+         /* The cast to unsigned char is for 8-bit characters, which
+            could be passed as negative integers to character_width
+            and wreak havoc on some naive implementations of iscntrl.  */
+          c = (unsigned char)node->contents[i];
           cwidth = character_width (c, hpos);
 
           /* If this character fits within this line, just do the next one. */



reply via email to

[Prev in Thread] Current Thread [Next in Thread]