[Pkg-nethack-devel] nethack/patches 90_enh_hpmon.dpatch,1.3,1.4 91_enh_menucolors.dpatch,1.2,1.3

Joshua Kwan joshk-guest@quantz.debian.org
Tue, 23 Dec 2003 00:54:25 +0000


Update of /cvsroot/pkg-nethack/nethack/patches
In directory quantz:/tmp/cvs-serv14372/patches

Modified Files:
	90_enh_hpmon.dpatch 91_enh_menucolors.dpatch 
Log Message:
90_enh_hpmon.dpatch: give Ralph Churchill the credit, not myself
91_enh_menucolors.dpatch: update to 3.4.3 version and credit Pasi Kallinen


Index: 91_enh_menucolors.dpatch
===================================================================
RCS file: /cvsroot/pkg-nethack/nethack/patches/91_enh_menucolors.dpatch,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- 91_enh_menucolors.dpatch	9 Dec 2003 16:52:02 -0000	1.2
+++ 91_enh_menucolors.dpatch	23 Dec 2003 00:54:22 -0000	1.3
@@ -1,5 +1,5 @@
 #! /bin/sh -e
-## 91_enh_menucolors.dpatch by Joshua Kwan <joshk@triplehelix.org>
+## 91_enh_menucolors.dpatch by Pasi Kallinen <pk@cs.joensuu.fi>
 ##
 ## All lines beginning with `## DP:' are a description of the patch.
 ## DP: Pasi Kallinen's patch to add colors to inventory items.
@@ -18,9 +18,9 @@
 
 exit 0
 
-diff -Nurd --exclude-from=diff_ignore_files.txt nethack-3.4.2-orig/dat/opthelp nethack-3.4.2-menucolor/dat/opthelp
---- nethack-3.4.2-orig/dat/opthelp	2003-08-30 03:07:07.000000000 +0300
-+++ nethack-3.4.2-menucolor/dat/opthelp	2003-09-04 21:06:26.000000000 +0300
+diff -Nurd --exclude-from=diff_ignore_files.txt nethack-3.4.3-orig/dat/opthelp nethack-3.4.3-menucolor/dat/opthelp
+--- nethack-3.4.3-orig/dat/opthelp	2003-12-09 17:23:52.000000000 +0200
++++ nethack-3.4.3-menucolor/dat/opthelp	2003-12-10 05:06:38.000000000 +0200
 @@ -71,6 +71,9 @@
  color      use different colors for objects on screen   [TRUE for micros]
  hilite_pet display pets in a highlighted manner                   [FALSE]
@@ -42,20 +42,20 @@
 +	   all lines in a menu with the text " blessed " in green.
 +	   The string is matched using regular expressions.
 +	   Valid values for the color are black, red, green, brown, blue,
-+	   magenta, cyan, gray, orange, lightgreen, yellow, lightblue, 
++	   magenta, cyan, gray, orange, lightgreen, yellow, lightblue,
 +	   lightmagenta, lightcyan and white.
 +	   You can define menucolor as many times as you wish; those
 +	   defined later will take precedence.
-+	   Instead of using this with OPTIONS, consider using 
++	   Instead of using this with OPTIONS, consider using
 +	   MENUCOLOR="regex_string"=color in the configuration file.
 +	   Setting menucolor has effect only if TEXTCOLOR and MENU_COLOR
 +	   were set at compile time.  [NONE]
  menu_*     create single character accelerators for menu commands.  Below
             is a list of all commands.  Each is followed by a list of window-
             ports that implement them:  'x' is X11, 't' is tty, 'g' is Gem,
-diff -Nurd --exclude-from=diff_ignore_files.txt nethack-3.4.2-orig/include/color.h nethack-3.4.2-menucolor/include/color.h
---- nethack-3.4.2-orig/include/color.h	2003-08-30 03:07:15.000000000 +0300
-+++ nethack-3.4.2-menucolor/include/color.h	2003-09-04 21:06:26.000000000 +0300
+diff -Nurd --exclude-from=diff_ignore_files.txt nethack-3.4.3-orig/include/color.h nethack-3.4.3-menucolor/include/color.h
+--- nethack-3.4.3-orig/include/color.h	2003-12-09 17:23:52.000000000 +0200
++++ nethack-3.4.3-menucolor/include/color.h	2003-12-10 05:08:55.000000000 +0200
 @@ -5,6 +5,12 @@
  #ifndef COLOR_H
  #define COLOR_H
@@ -63,7 +63,7 @@
 +#ifdef MENU_COLOR
 +# ifdef MENU_COLOR_REGEX
 +#  include <regex.h>
-+# endif  
++# endif
 +#endif
 +
  /*
@@ -76,20 +76,20 @@
 +#ifdef MENU_COLOR
 +struct menucoloring {
 +# ifdef MENU_COLOR_REGEX
-+   struct re_pattern_buffer match;
++    struct re_pattern_buffer match;
 +# else
-+   char *match;
++    char *match;
 +# endif
-+   int color, attr;
-+   struct menucoloring *next;
++    int color, attr;
++    struct menucoloring *next;
 +};
-+#endif
++#endif /* MENU_COLOR */
 +
  #endif /* COLOR_H */
-diff -Nurd --exclude-from=diff_ignore_files.txt nethack-3.4.2-orig/include/config.h nethack-3.4.2-menucolor/include/config.h
---- nethack-3.4.2-orig/include/config.h	2003-08-30 03:07:15.000000000 +0300
-+++ nethack-3.4.2-menucolor/include/config.h	2003-09-04 21:06:26.000000000 +0300
-@@ -350,6 +350,14 @@
+diff -Nurd --exclude-from=diff_ignore_files.txt nethack-3.4.3-orig/include/config.h nethack-3.4.3-menucolor/include/config.h
+--- nethack-3.4.3-orig/include/config.h	2003-12-09 17:26:08.000000000 +0200
++++ nethack-3.4.3-menucolor/include/config.h	2003-12-10 05:09:50.000000000 +0200
+@@ -348,6 +348,15 @@
   * bugs left here.
   */
  
@@ -101,26 +101,27 @@
 + * pmatch() provides basic globbing: '*' and '?' wildcards.
 + */
 +#endif
++
  /*#define GOLDOBJ */	/* Gold is kept on obj chains - Helge Hafting */
+ /*#define AUTOPICKUP_EXCEPTIONS */ /* exceptions to autopickup */
  
- /* End of Section 5 */
-diff -Nurd --exclude-from=diff_ignore_files.txt nethack-3.4.2-orig/include/extern.h nethack-3.4.2-menucolor/include/extern.h
---- nethack-3.4.2-orig/include/extern.h	2003-08-30 03:07:17.000000000 +0300
-+++ nethack-3.4.2-menucolor/include/extern.h	2003-09-04 21:06:26.000000000 +0300
-@@ -1395,6 +1395,9 @@
- E void FDECL(set_wc_option_mod_status, (unsigned long, int));
- E void FDECL(set_wc2_option_mod_status, (unsigned long, int));
- E void FDECL(set_option_mod_status, (const char *,int));
-+#ifdef MENU_COLOR
-+E boolean FDECL(add_menu_coloring, (char *));
-+#endif
- #ifdef AUTOPICKUP_EXCEPTIONS
+diff -Nurd --exclude-from=diff_ignore_files.txt nethack-3.4.3-orig/include/extern.h nethack-3.4.3-menucolor/include/extern.h
+--- nethack-3.4.3-orig/include/extern.h	2003-12-09 17:23:52.000000000 +0200
++++ nethack-3.4.3-menucolor/include/extern.h	2003-12-10 05:10:29.000000000 +0200
+@@ -1405,6 +1405,9 @@
  E int FDECL(add_autopickup_exception, (const char *));
  E void NDECL(free_autopickup_exceptions);
-diff -Nurd --exclude-from=diff_ignore_files.txt nethack-3.4.2-orig/include/flag.h nethack-3.4.2-menucolor/include/flag.h
---- nethack-3.4.2-orig/include/flag.h	2003-08-30 03:07:17.000000000 +0300
-+++ nethack-3.4.2-menucolor/include/flag.h	2003-09-04 21:06:26.000000000 +0300
-@@ -181,6 +181,9 @@
+ #endif /* AUTOPICKUP_EXCEPTIONS */
++#ifdef MENU_COLOR
++E boolean FDECL(add_menu_coloring, (char *));
++#endif /* MENU_COLOR */
+ 
+ /* ### pager.c ### */
+ 
+diff -Nurd --exclude-from=diff_ignore_files.txt nethack-3.4.3-orig/include/flag.h nethack-3.4.3-menucolor/include/flag.h
+--- nethack-3.4.3-orig/include/flag.h	2003-12-09 17:23:52.000000000 +0200
++++ nethack-3.4.3-menucolor/include/flag.h	2003-12-10 05:12:35.000000000 +0200
+@@ -183,6 +183,9 @@
  	char prevmsg_window;	/* type of old message window to use */
  	boolean  extmenu;	/* extended commands use menu interface */
  #endif
@@ -130,12 +131,12 @@
  #ifdef MFLOPPY
  	boolean  checkspace;	/* check disk space before writing files */
  				/* (in iflags to allow restore after moving
-diff -Nurd --exclude-from=diff_ignore_files.txt nethack-3.4.2-orig/README.menucolor nethack-3.4.2-menucolor/README.menucolor
---- nethack-3.4.2-orig/README.menucolor	1970-01-01 02:00:00.000000000 +0200
-+++ nethack-3.4.2-menucolor/README.menucolor	2003-09-04 21:33:09.000000000 +0300
-@@ -0,0 +1,92 @@
+diff -Nurd --exclude-from=diff_ignore_files.txt nethack-3.4.3-orig/README.menucolor nethack-3.4.3-menucolor/README.menucolor
+--- nethack-3.4.3-orig/README.menucolor	1970-01-01 02:00:00.000000000 +0200
++++ nethack-3.4.3-menucolor/README.menucolor	2003-12-10 06:14:20.000000000 +0200
+@@ -0,0 +1,96 @@
 +
-+   This is version 1.2 of the menucolors patch.
++   This is version 1.3 of the menucolors patch.
 +
 +   This patch allows the user to define in what color menus are shown.
 +   For example, putting
@@ -185,6 +186,10 @@
 +
 +   FIXES:
 +
++   v1.3:
++    o Updated to use 3.4.3 codebase.
++    o Added a text to #version to show menucolors is compiled in.
++
 +   v1.2:
 +    o Updated to use 3.4.2 codebase.
 +
@@ -226,9 +231,9 @@
 +--
 + Pasi Kallinen
 + pkalli@cs.joensuu.fi
-diff -Nurd --exclude-from=diff_ignore_files.txt nethack-3.4.2-orig/src/decl.c nethack-3.4.2-menucolor/src/decl.c
---- nethack-3.4.2-orig/src/decl.c	2003-08-30 03:07:28.000000000 +0300
-+++ nethack-3.4.2-menucolor/src/decl.c	2003-09-04 21:06:26.000000000 +0300
+diff -Nurd --exclude-from=diff_ignore_files.txt nethack-3.4.3-orig/src/decl.c nethack-3.4.3-menucolor/src/decl.c
+--- nethack-3.4.3-orig/src/decl.c	2003-12-09 17:23:52.000000000 +0200
++++ nethack-3.4.3-menucolor/src/decl.c	2003-12-10 05:14:53.000000000 +0200
 @@ -235,6 +235,10 @@
  	"white",		/* CLR_WHITE */
  };
@@ -240,23 +245,23 @@
  struct c_common_strings c_common_strings = {
  	"Nothing happens.",		"That's enough tries!",
  	"That is a silly thing to %s.",	"shudder for a moment.",
-diff -Nurd --exclude-from=diff_ignore_files.txt nethack-3.4.2-orig/src/files.c nethack-3.4.2-menucolor/src/files.c
---- nethack-3.4.2-orig/src/files.c	2003-08-30 03:07:31.000000000 +0300
-+++ nethack-3.4.2-menucolor/src/files.c	2003-09-04 21:06:26.000000000 +0300
-@@ -1779,6 +1779,10 @@
+diff -Nurd --exclude-from=diff_ignore_files.txt nethack-3.4.3-orig/src/files.c nethack-3.4.3-menucolor/src/files.c
+--- nethack-3.4.3-orig/src/files.c	2003-12-09 17:23:52.000000000 +0200
++++ nethack-3.4.3-menucolor/src/files.c	2003-12-10 05:42:43.000000000 +0200
+@@ -1794,6 +1794,10 @@
  	} else if (match_varname(buf, "BOULDER", 3)) {
  	    (void) get_uchars(fp, buf, bufp, &iflags.bouldersym, TRUE,
  			      1, "BOULDER");
 +	} else if (match_varname(buf, "MENUCOLOR", 9)) {
 +#ifdef MENU_COLOR
-+	   add_menu_coloring(bufp);
++	    (void) add_menu_coloring(bufp);
 +#endif
  	} else if (match_varname(buf, "GRAPHICS", 4)) {
  	    len = get_uchars(fp, buf, bufp, translate, FALSE,
  			     MAXPCHARS, "GRAPHICS");
-diff -Nurd --exclude-from=diff_ignore_files.txt nethack-3.4.2-orig/src/options.c nethack-3.4.2-menucolor/src/options.c
---- nethack-3.4.2-orig/src/options.c	2003-08-30 03:07:36.000000000 +0300
-+++ nethack-3.4.2-menucolor/src/options.c	2003-09-04 21:06:26.000000000 +0300
+diff -Nurd --exclude-from=diff_ignore_files.txt nethack-3.4.3-orig/src/options.c nethack-3.4.3-menucolor/src/options.c
+--- nethack-3.4.3-orig/src/options.c	2003-12-09 17:23:52.000000000 +0200
++++ nethack-3.4.3-menucolor/src/options.c	2003-12-10 05:19:58.000000000 +0200
 @@ -125,6 +125,15 @@
  #else
  	{"mail", (boolean *)0, TRUE, SET_IN_FILE},
@@ -281,7 +286,7 @@
  	{ "menustyle", "user interface for object selection",
  						MENUTYPELEN, SET_IN_GAME },
  	{ "menu_deselect_all", "deselect all items in a menu", 4, SET_IN_FILE },
-@@ -958,6 +968,120 @@
+@@ -964,6 +974,120 @@
  	}
  }
  
@@ -327,82 +332,82 @@
 +add_menu_coloring(str)
 +char *str;
 +{
-+   int i, c = NO_COLOR, a = ATR_NONE;
-+   struct menucoloring *tmp;
-+   char *tmps, *cs = strchr(str, '=');
-+   const char *err = (char *)0;
-+   
-+   if (!cs || !str) return FALSE;
-+   
-+   tmps = cs;
-+   tmps++;
-+   while (*tmps && isspace(*tmps)) tmps++;
++    int i, c = NO_COLOR, a = ATR_NONE;
++    struct menucoloring *tmp;
++    char *tmps, *cs = strchr(str, '=');
++    const char *err = (char *)0;
 +
-+   for (i = 0; i < SIZE(colornames); i++)
-+     if (strstri(tmps, colornames[i].name) == tmps) {
-+	c = colornames[i].color;
-+	break;
-+     }
-+   if ((i == SIZE(colornames)) && (*tmps >= '0' && *tmps <='9'))
-+     c = atoi(tmps);
-+   
-+   if (c > 15) return FALSE;
-+   
-+   tmps = strchr(str, '&');
-+   if (tmps) {
-+      tmps++;
-+      while (*tmps && isspace(*tmps)) tmps++;
-+      for (i = 0; i < SIZE(attrnames); i++)
-+	if (strstri(tmps, attrnames[i].name) == tmps) {
-+	   a = attrnames[i].attr;
-+	   break;
++    if (!cs || !str) return FALSE;
++
++    tmps = cs;
++    tmps++;
++    while (*tmps && isspace(*tmps)) tmps++;
++
++    for (i = 0; i < SIZE(colornames); i++)
++	if (strstri(tmps, colornames[i].name) == tmps) {
++	    c = colornames[i].color;
++	    break;
 +	}
-+      if ((i == SIZE(attrnames)) && (*tmps >= '0' && *tmps <='9'))
-+	a = atoi(tmps);
-+   }
-+   
-+   *cs = '\0';
-+   tmps = str;
-+   if ((*tmps == '"') || (*tmps == '\'')) {
-+      cs--;
-+      while (isspace(*cs)) cs--;
-+      if (*cs == *tmps) {
-+	 *cs = '\0';
-+	 tmps++;
-+      }
-+   }
-+   
-+   tmp = (struct menucoloring *)alloc(sizeof(struct menucoloring));
++    if ((i == SIZE(colornames)) && (*tmps >= '0' && *tmps <='9'))
++	c = atoi(tmps);
++
++    if (c > 15) return FALSE;
++
++    tmps = strchr(str, '&');
++    if (tmps) {
++	tmps++;
++	while (*tmps && isspace(*tmps)) tmps++;
++	for (i = 0; i < SIZE(attrnames); i++)
++	    if (strstri(tmps, attrnames[i].name) == tmps) {
++		a = attrnames[i].attr;
++		break;
++	    }
++	if ((i == SIZE(attrnames)) && (*tmps >= '0' && *tmps <='9'))
++	    a = atoi(tmps);
++    }
++
++    *cs = '\0';
++    tmps = str;
++    if ((*tmps == '"') || (*tmps == '\'')) {
++	cs--;
++	while (isspace(*cs)) cs--;
++	if (*cs == *tmps) {
++	    *cs = '\0';
++	    tmps++;
++	}
++    }
++
++    tmp = (struct menucoloring *)alloc(sizeof(struct menucoloring));
 +#ifdef MENU_COLOR_REGEX
-+   tmp->match.translate = 0;
-+   tmp->match.fastmap = 0;
-+   tmp->match.buffer = 0;
-+   tmp->match.allocated = 0;
-+   tmp->match.regs_allocated = REGS_FIXED;
-+   err = re_compile_pattern(tmps, strlen(tmps), &tmp->match);
++    tmp->match.translate = 0;
++    tmp->match.fastmap = 0;
++    tmp->match.buffer = 0;
++    tmp->match.allocated = 0;
++    tmp->match.regs_allocated = REGS_FIXED;
++    err = re_compile_pattern(tmps, strlen(tmps), &tmp->match);
 +#else
-+   tmp->match = (char *)alloc(strlen(tmps)+1);
-+   (void) memcpy((genericptr_t)tmp->match, (genericptr_t)tmps, strlen(tmps)+1);
++    tmp->match = (char *)alloc(strlen(tmps)+1);
++    (void) memcpy((genericptr_t)tmp->match, (genericptr_t)tmps, strlen(tmps)+1);
 +#endif
-+   if (err) {
-+      raw_printf("\nMenucolor regex error: %s\n", err);
-+      wait_synch();
-+      free(tmp);
-+      return FALSE;
-+   } else {
-+      tmp->next = menu_colorings;
-+      tmp->color = c;
-+      tmp->attr = a;
-+      menu_colorings = tmp;
-+      return TRUE;
-+   }
++    if (err) {
++	raw_printf("\nMenucolor regex error: %s\n", err);
++	wait_synch();
++	free(tmp);
++	return FALSE;
++    } else {
++	tmp->next = menu_colorings;
++	tmp->color = c;
++	tmp->attr = a;
++	menu_colorings = tmp;
++	return TRUE;
++    }
 +}
 +#endif /* MENU_COLOR */
 +
  void
  parseoptions(opts, tinitial, tfrom_file)
  register char *opts;
-@@ -1127,6 +1251,18 @@
+@@ -1133,6 +1257,18 @@
  		return;
  	}
  
@@ -410,20 +415,20 @@
 +	fullname = "menucolor";
 +	if (match_optname(opts, fullname, 9, TRUE)) {
 +#ifdef MENU_COLOR
-+		if (negated) bad_negation(fullname, FALSE);
-+		else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0)
-+			if (!add_menu_coloring(op))
-+				badoption(opts);
++	    if (negated) bad_negation(fullname, FALSE);
++	    else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0)
++		if (!add_menu_coloring(op))
++		    badoption(opts);
 +#endif
-+ 		return;
++	    return;
 +	}
 +
  	fullname = "msghistory";
  	if (match_optname(opts, fullname, 3, TRUE)) {
  		op = string_for_env_opt(fullname, opts, negated);
-diff -Nurd --exclude-from=diff_ignore_files.txt nethack-3.4.2-orig/src/save.c nethack-3.4.2-menucolor/src/save.c
---- nethack-3.4.2-orig/src/save.c	2003-08-30 03:07:39.000000000 +0300
-+++ nethack-3.4.2-menucolor/src/save.c	2003-09-04 21:06:26.000000000 +0300
+diff -Nurd --exclude-from=diff_ignore_files.txt nethack-3.4.3-orig/src/save.c nethack-3.4.3-menucolor/src/save.c
+--- nethack-3.4.3-orig/src/save.c	2003-12-09 17:23:52.000000000 +0200
++++ nethack-3.4.3-menucolor/src/save.c	2003-12-10 05:22:32.000000000 +0200
 @@ -48,6 +48,10 @@
  #define HUP
  #endif
@@ -435,7 +440,7 @@
  /* need to preserve these during save to avoid accessing freed memory */
  static unsigned ustuck_id = 0, usteed_id = 0;
  
-@@ -953,12 +957,35 @@
+@@ -953,12 +957,34 @@
  	return;
  }
  
@@ -443,21 +448,20 @@
 +void
 +free_menu_coloring()
 +{
-+   struct menucoloring *tmp = menu_colorings;
-+   
-+   while (tmp) {
-+      struct menucoloring *tmp2 = tmp->next;
++    struct menucoloring *tmp = menu_colorings;
++
++    while (tmp) {
++	struct menucoloring *tmp2 = tmp->next;
 +# ifdef MENU_COLOR_REGEX
-+      (void) regfree(&tmp->match);
++	(void) regfree(&tmp->match);
 +# else
-+      free(tmp->match);
++	free(tmp->match);
 +# endif
-+      free(tmp);
-+      tmp = tmp2;
-+   }
-+   return;
++	free(tmp);
++	tmp = tmp2;
++    }
 +}
-+#endif
++#endif /* MENU_COLOR */
 +
  void
  freedynamicdata()
@@ -471,9 +475,26 @@
  	tmp_at(DISP_FREEMEM, 0);	/* temporary display effects */
  #ifdef FREE_ALL_MEMORY
  # define freeobjchn(X)	(saveobjchn(0, X, FREE_SAVE),  X = 0)
-diff -Nurd --exclude-from=diff_ignore_files.txt nethack-3.4.2-orig/win/tty/wintty.c nethack-3.4.2-menucolor/win/tty/wintty.c
---- nethack-3.4.2-orig/win/tty/wintty.c	2003-08-30 03:08:26.000000000 +0300
-+++ nethack-3.4.2-menucolor/win/tty/wintty.c	2003-09-04 21:06:26.000000000 +0300
+diff -Nurd --exclude-from=diff_ignore_files.txt nethack-3.4.3-orig/util/makedefs.c nethack-3.4.3-menucolor/util/makedefs.c
+--- nethack-3.4.3-orig/util/makedefs.c	2003-12-09 17:23:52.000000000 +0200
++++ nethack-3.4.3-menucolor/util/makedefs.c	2003-12-10 06:03:57.000000000 +0200
+@@ -679,6 +679,13 @@
+ #ifdef MAIL
+ 		"mail daemon",
+ #endif
++#ifdef MENU_COLOR
++# ifdef MENU_COLOR_REGEX
++		"menu colors via regular expressions",
++# else
++		"menu colors via pmatch",
++# endif
++#endif
+ #ifdef GNUDOS
+ 		"MSDOS protected mode",
+ #endif
+diff -Nurd --exclude-from=diff_ignore_files.txt nethack-3.4.3-orig/win/tty/wintty.c nethack-3.4.3-menucolor/win/tty/wintty.c
+--- nethack-3.4.3-orig/win/tty/wintty.c	2003-12-09 17:23:52.000000000 +0200
++++ nethack-3.4.3-menucolor/win/tty/wintty.c	2003-12-10 05:25:46.000000000 +0200
 @@ -125,6 +125,10 @@
  static char winpanicstr[] = "Bad window id %d";
  char defmorestr[] = "--More--";
@@ -485,7 +506,7 @@
  #ifdef CLIPPING
  # if defined(USE_TILES) && defined(MSDOS)
  boolean clipping = FALSE;	/* clipping on? */
-@@ -1122,6 +1126,28 @@
+@@ -1128,6 +1132,28 @@
      }
  }
  
@@ -495,58 +516,58 @@
 +char *str;
 +int *color, *attr;
 +{
-+   struct menucoloring *tmpmc;
-+   if (iflags.use_menu_color)
-+     for (tmpmc = menu_colorings; tmpmc; tmpmc = tmpmc->next)
++    struct menucoloring *tmpmc;
++    if (iflags.use_menu_color)
++	for (tmpmc = menu_colorings; tmpmc; tmpmc = tmpmc->next)
 +# ifdef MENU_COLOR_REGEX
-+       if (re_search(&tmpmc->match, str, strlen(str), 0, 9999, 0) >= 0) {
++	    if (re_search(&tmpmc->match, str, strlen(str), 0, 9999, 0) >= 0) {
 +# else
-+       if (pmatch(tmpmc->match, str)) {
++	    if (pmatch(tmpmc->match, str)) {
 +# endif
-+	  *color = tmpmc->color;
-+	  *attr = tmpmc->attr;
-+	 return TRUE;
-+       }
-+   return FALSE;
++		*color = tmpmc->color;
++		*attr = tmpmc->attr;
++		return TRUE;
++	    }
++    return FALSE;
 +}
 +#endif /* MENU_COLOR */
 +
  STATIC_OVL void
  process_menu_window(window, cw)
  winid window;
-@@ -1198,6 +1224,10 @@
+@@ -1204,6 +1230,10 @@
  		for (page_lines = 0, curr = page_start;
  			curr != page_end;
  			page_lines++, curr = curr->next) {
 +#ifdef MENU_COLOR
-+		   int color = NO_COLOR, attr = ATR_NONE;
-+		   boolean menucolr = FALSE;
++		    int color = NO_COLOR, attr = ATR_NONE;
++		    boolean menucolr = FALSE;
 +#endif
  		    if (curr->selector)
  			*rp++ = curr->selector;
  
-@@ -1213,6 +1243,13 @@
+@@ -1219,6 +1249,13 @@
  		     * actually output the character.  We're faster doing
  		     * this.
  		     */
 +#ifdef MENU_COLOR
 +		   if (iflags.use_menu_color &&
 +		       (menucolr = get_menu_coloring(curr->str, &color,&attr))) {
-+		      term_start_attr(attr);
-+		      if (color != NO_COLOR) term_start_color(color);
++		       term_start_attr(attr);
++		       if (color != NO_COLOR) term_start_color(color);
 +		   } else
 +#endif
  		    term_start_attr(curr->attr);
  		    for (n = 0, cp = curr->str;
- 			  *cp && (int) ++ttyDisplay->curx < (int) ttyDisplay->cols;
-@@ -1225,6 +1262,12 @@
+ #ifndef WIN32CON
+@@ -1236,6 +1273,12 @@
  				(void) putchar('#'); /* count selected */
  			} else
  			    (void) putchar(*cp);
 +#ifdef MENU_COLOR
 +		   if (iflags.use_menu_color && menucolr) {
-+		      if (color != NO_COLOR) term_end_color();
-+		      term_end_attr(attr);
++		       if (color != NO_COLOR) term_end_color();
++		       term_end_attr(attr);
 +		   } else
 +#endif
  		    term_end_attr(curr->attr);

Index: 90_enh_hpmon.dpatch
===================================================================
RCS file: /cvsroot/pkg-nethack/nethack/patches/90_enh_hpmon.dpatch,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- 90_enh_hpmon.dpatch	9 Dec 2003 16:52:02 -0000	1.3
+++ 90_enh_hpmon.dpatch	23 Dec 2003 00:54:22 -0000	1.4
@@ -1,5 +1,5 @@
 #! /bin/sh -e
-## 90_enh_hpmon.dpatch by Joshua Kwan <joshk@triplehelix.org>
+## 90_enh_hpmon.dpatch by Ralph Churchill <mrchucho@yahoo.com>
 ##
 ## All lines beginning with `## DP:' are a description of the patch.
 ## DP: Enables color HP monitor for textmode NetHack.