lynx-dev
[Top][All Lists]
Advanced

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

LYNX-DEV Bugs in ac102 (at least for DOS)


From: Doug Kaufman
Subject: LYNX-DEV Bugs in ac102 (at least for DOS)
Date: Sun, 21 Dec 1997 23:22:25 -0800 (PST)

I just compiled and tested version 102 (the first I have done since 98).
Color support for DOS was completely broken.  Changes in LYCurses.c made
color never start.  The color mapping change in LYReadCFG.c didn't work,
with DOS colors mapped incorrectly.  The following patch fixes
LYCurses.c for DOS.  I hope that it doesn't break any other systems (I
am not sure why the changes were made).  For LYReadCFG.c, I just put
back the color table that was in previous versions.  I'll try to look at
functionality more, now that I have colors working again.

P.S. The LYReadCFG.c file in 102 wouldn't compile without adding 
"int n;" to ColorCode.

                          Doug


*** lynx2-7-1/src/LYCurses.c    Sun Dec 14 14:41:28 1997
--- lynx2-7-1/src/LYCurses.c.new        Sun Dec 21 22:35:46 1997
***************
*** 589,596 ****
  
  PRIVATE void lynx_init_colors NOARGS
  {
!     if (lynx_has_color) {
        int n, m;
  
        lynx_color_cfg[0].fg = default_fg;
        lynx_color_cfg[0].bg = default_bg;
--- 589,599 ----
  
  PRIVATE void lynx_init_colors NOARGS
  {
!     lynx_has_color = FALSE;
!     if (has_colors()) {
        int n, m;
+       lynx_has_color = TRUE;
+       start_color();
  
        lynx_color_cfg[0].fg = default_fg;
        lynx_color_cfg[0].bg = default_bg;
*** lynx2-7-1/src/LYReadCFG.c   Sun Dec 14 14:41:28 1997
--- lynx2-7-1/src/LYReadCFG.c.new       Sun Dec 21 22:54:00 1997
***************
*** 298,303 ****
--- 298,324 ----
  int default_fg = COLOR_WHITE;
  int default_bg = COLOR_BLACK;
  
+ #ifdef DOSPATH /* I.E. broken curses */
+ static char *Color_Strings[16] =
+ {
+        "black",
+        "blue",
+        "green",
+        "cyan",
+        "red",
+        "magenta",
+        "brown",
+        "lightgray",
+        "gray",
+        "brightblue",
+        "brightgreen",
+        "brightcyan",
+        "brightred",
+        "brightmagenta",
+        "yellow",
+        "white"
+ };
+ #else
  static char *Color_Strings[16] =
  {
      "black",
***************
*** 317,339 ****
      "brightcyan",
      "white"
  };
! 
! #ifdef DOSPATH
! /*
!  * PDCurses (and possibly some other implementations) use a non-ANSI set of
!  * codes for colors.
!  */
! PRIVATE int ColorCode ARGS1(
!       int,    color)
! {
!       static int map[] = {
!               0,  4,  2,  6, 1,  5,  3,  7,
!               8, 12, 10, 14, 9, 13, 11, 15 };
!       return map[n];
! }
! #else
! #define ColorCode(n) (n)
! #endif
  
  /*
   *  Validator for COLOR fields.
--- 338,344 ----
      "brightcyan",
      "white"
  };
! #endif /* DOSPATH (broken curses) */
  
  /*
   *  Validator for COLOR fields.
***************
*** 351,357 ****
  
      for (i = 0; i < 16; i++) {
        if (!strcasecmp(color, Color_Strings[i]))
!           return ColorCode(i);
      }
      return ERR_COLOR;
  }
--- 356,362 ----
  
      for (i = 0; i < 16; i++) {
        if (!strcasecmp(color, Color_Strings[i]))
!           return i;
      }
      return ERR_COLOR;
  }

__
Doug Kaufman
Internet: address@hidden (preferred)
          address@hidden

reply via email to

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