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: Mirsad Todorovac
Subject: Re: GNU info: bug: menu & iso-8859-2 chars problem
Date: Wed, 9 Jan 2002 14:19:04 +0100 (MET)

On Wed, 9 Jan 2002, Eli Zaretskii wrote:

Eli,

> 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.

I'm impressed: this was really quick :-)))))) ...

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

OK, thanks. But the real advantage will show up when this change will
propagate to next release of info, so all prospective readers of
GNU Pascal (and all other!!) translated docs will benefit from the fix :-) 

> 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. 
> */

I've also wrote a lot of code that relied uppon the 'fact' that characters
are 7-bit ...

Thanks for your effort.

Mirsad

Mirsad Todorovac                                          address@hidden
CARNet, UNI-ZG, Croatia                                   address@hidden
-------------------------------------------------------------------------
"Secularism is the opiate of the people." -- Stephen Baars





reply via email to

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