Subject: Re: HEADS UP: new curses in tree
To: Brett Lymn <blymn@baesystems.com.au>
From: MINOURA Makoto <minoura@netbsd.org>
List: tech-userlevel
Date: 12/07/2001 01:15:21
It seems this change broke menuc(1).
Could someone fix this?  My suggestion is following but we
should look at the termcap which curses actually uses.

-- 
Minoura Makoto <minoura@netbsd.org>

Index: menu_sys.def
===================================================================
RCS file: /cvsroot/basesrc/usr.bin/menuc/menu_sys.def,v
retrieving revision 1.26
diff -u -r1.26 menu_sys.def
--- menu_sys.def	2001/11/17 01:12:47	1.26
+++ menu_sys.def	2001/12/06 16:05:13
@@ -40,6 +40,7 @@
 
 #include <string.h>
 #include <ctype.h>
+#include <stdlib.h>
 
 #define REQ_EXECUTE    1000
 #define REQ_NEXT_ITEM  1001
@@ -153,15 +154,18 @@
 	 * XXX XXX XXX THIS SHOULD BE NUKED FROM ORBIT!  DO THIS
 	 * XXX XXX XXX WITH NORMAL CURSES FACILITIES!
 	 */
-	extern struct tinfo *_cursesi_genbuf;
-
+	struct tinfo *ti;
 	int i;
+	char *term = getenv("TERM");
 
+	if (term && term[0]) {
+		if (t_getent(&ti, term) < 0)
+			ti = NULL;
+	}
 	for (i=0; i<_mc_num_key_seq; i++) {
-		if (_mc_key_seq[i].termcap_name)
+		if (_mc_key_seq[i].termcap_name && ti)
 			_mc_key_seq[i].chars =
-				t_getstr (_cursesi_genbuf,
-				      _mc_key_seq[i].termcap_name,
+				t_getstr (ti, _mc_key_seq[i].termcap_name,
 				      &str_ptr, NULL);
 		if (_mc_key_seq[i].chars != NULL &&
 		    (_mc_key_seq[i].numchars = strlen(_mc_key_seq[i].chars))