lynx-dev
[Top][All Lists]
Advanced

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

Re: lynx-dev lynx --enable-color-style causes fp error


From: Klaus Weide
Subject: Re: lynx-dev lynx --enable-color-style causes fp error
Date: Fri, 27 Nov 1998 11:03:42 -0600 (CST)

On Thu, 26 Nov 1998, Stanislav Brabec wrote:

> Lynx crashes whenever --enable-color-style and curses COLORS==0.
> 
> I was done some tracing with TERM=xterm (from ncurses-4.2 terminfo database).
> There is defined no color support and it causes lynx 2.8 to hang (see gdb 
> output).
> The same code works OK with xfree-3.3.2 terminfo.
> 
> 
> This works:
> configure --prefix=/usr --with-screen=slang --enable-8bit-toupper 
> --enable-default-colors \
> --enable-externs --enable-font-switch --enable-internal-links 
> --enable-nsl-fork \
> --enable-underlines --with-zlib
> 
> This is buggy:
> configure --prefix=/usr --enable-color-style --enable-debug
> -------------------------------------------------------------
> 
> exception in: src/LYStyle.c
> *************************************************************
>     bA = check_color(bg, default_bg);
>     if (fA == NO_COLOR) {
>       bA = NO_COLOR;
>     } else {
>       if (fA >= COLORS || bA >= COLORS)
>           cA = A_BOLD;
>       if (fA >= COLORS)
> ->        fA %= COLORS;
>       if (bA > COLORS)
>           bA %= COLORS;
>     }

The 2.8.1(rel.2) already has protection against this crash, the code now
looks like this:

    bA = check_color(bg, default_bg);
    if (fA == NO_COLOR) {
        bA = NO_COLOR;
    } else if (COLORS) {
        if (fA >= COLORS || bA >= COLORS)
            cA = A_BOLD;
        if (fA >= COLORS)
            fA %= COLORS;
        if (bA > COLORS)
            bA %= COLORS;
    } else {
        cA = A_BOLD;
        fA = NO_COLOR;
        bA = NO_COLOR;
    }



    Klaus

reply via email to

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