File tree Expand file tree Collapse file tree 3 files changed +26
-1
lines changed
Expand file tree Collapse file tree 3 files changed +26
-1
lines changed Original file line number Diff line number Diff line change 507507
508508 DEFS=" $DEFS -DHAVE_CURSES_WCH"
509509}
510+ check_curses_keyname () {
511+ check_for " keyname(3)"
512+
513+ cat << EOT >$TMPC
514+ #include "compat.h"
515+ int
516+ main(int argc, char **argv) {
517+ (void)argv;
518+ puts(keyname(argc));
519+ return 0;
520+ }
521+ EOT
522+ gen_mk
523+ cat << EOT >>$OUTMK
524+ $TMPNAM : ${TMPNAM} .o
525+ \$ (CC) \$ (_CFLAGS) \$ (_LDFLAGS) \$ (RPATH_CURSES) -o \$ @ ${TMPNAM} .o \$ (LDADD)
526+ EOT
527+ compile
528+ test_result || return ;
529+
530+ DEFS=" $DEFS -DHAVE_CURSES_KEYNAME"
531+ }
510532check_isfinite () {
511533 check_for " isfinite(3)"
512534
@@ -578,6 +600,7 @@ check_strlcpy
578600check_strlcat
579601check_lib_curses
580602check_curses_wch
603+ check_curses_keyname
581604check_isfinite
582605
583606gen_mk
Original file line number Diff line number Diff line change @@ -317,6 +317,7 @@ dogetkey(void) {
317317 if (c < 256 ) {
318318 snprintf (line , sizeof line , "%c" , c );
319319 len = 1 ;
320+ #ifdef HAVE_CURSES_KEYNAME
320321 } else if (c >= KEY_MIN && c <= KEY_MAX ) {
321322 int i , j ;
322323 line [0 ] = '\0' ;
@@ -328,6 +329,7 @@ dogetkey(void) {
328329 line [i ++ ] = line [j ++ ];
329330 }
330331 len = strlen (line + 1 ) + 1 ;
332+ #endif
331333 } else {
332334 line [0 ] = '0' ;
333335 snprintf (line + 1 , sizeof (line ) - 1 , "UNKNOWN KEY" );
Original file line number Diff line number Diff line change 77 */
88
99extern char * rev ;
10- char * rev = "$Revision: 7.16_1.1.1 170217 $" ;
10+ char * rev = "$Revision: 7.16_1.1.1 170828 1704 $" ;
You can’t perform that action at this time.
0 commit comments