lynx-dev
[Top][All Lists]
Advanced

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

lynx-dev Use attron() not attrset() with FANCY_CURSES


From: Julian Coleman
Subject: lynx-dev Use attron() not attrset() with FANCY_CURSES
Date: Wed, 23 Jun 1999 11:13:13 +0100

I've been adding extra functionality to the NetBSD curses library (character
attributes) and I believe that I've come across a bug in lynx.  If the
curses library causes FANCY_CURSES to be defined but not COLOR_CURSES, the
code can call attrset() twice for the same characters, thus replacing the
original attribute with the new one.  The following page illustrates the
problem :

<HTML>
  <HEAD>
    <TITLE>Erk!</TITLE>
  </HEAD>
  <BODY>
    <P>
      <STRONG>
        <A HREF="http://lynx.browser.org/";>Lynx Information</A>
      </STRONG>
    <P>
      <STRONG>
        <A HREF="http://sol.slcc.edu/lynx/";>SLCC Lynx Pages</A>
      </STRONG>
  </BODY>
</HTML>

When the page is initially displayed, the links are bold only, but when the
highlight is moved off them, they become underlined only - because when the
page is displayed, the sequence is :

  attrset(A_UNDERSCODE);
    ...
  attrset(A_BOLD);

but when the highlight is moved, the sequence is :

  attrset(A_BOLD);
    ...
  attrset(A_UNDERSCODE);

It's possible to reproduce this under Solaris 2 by running `configure` and
then commenting out '#define COLOR_CURSES 1' from lynx_cfg.h.

I suggest the appended patch to Src/LYCurses.h.  Lynx version is 2.8.2rel1
but the problem also occurs in earlier versions.

J

-- 
          NetBSD - the most widely ported operating system available

 ---8<---------------------------- Cut here ---------------------------->8---

*** src/LYCurses.h.dist Thu May 13 03:06:05 1999
--- src/LYCurses.h      Fri Jun 18 16:25:40 1999
***************
*** 309,316 ****
  #undef  standend
  #define standend()            lynx_standout(FALSE)
  #else
! #define LYaddAttr             attrset
! #define LYaddWAttr            wattrset
  #define LYsubAttr             attroff
  #define LYsubWAttr            wattroff
  #endif
--- 309,316 ----
  #undef  standend
  #define standend()            lynx_standout(FALSE)
  #else
! #define LYaddAttr             attron
! #define LYaddWAttr            wattron
  #define LYsubAttr             attroff
  #define LYsubWAttr            wattroff
  #endif

reply via email to

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