From: Thomas E. Dickey Date: Sun, 27 Dec 2009 16:59:25 +0000 (+0000) Subject: ncurses 5.7 - patch 20091227 X-Git-Tag: v5.8~55 X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=commitdiff_plain;h=2debf76e0c23a2b3d1333f0853317a7b2ae1777f ncurses 5.7 - patch 20091227 + change order of lookup in progs/tput.c, looking for terminfo data first. This fixes a confusion between termcap "sg" and terminfo "sgr" or "sgr0", originally from 990123 changes, but exposed by 20091114 fixes for hashing. With this change, only "dl" and "ed" are ambiguous (Mandriva #56272). --- diff --git a/NEWS b/NEWS index a283351c..a2038f45 100644 --- a/NEWS +++ b/NEWS @@ -25,7 +25,7 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------- --- $Id: NEWS,v 1.1482 2009/12/26 22:19:54 tom Exp $ +-- $Id: NEWS,v 1.1484 2009/12/27 16:25:58 tom Exp $ ------------------------------------------------------------------------------- This is a log of changes that ncurses has gone through since Zeyd started @@ -45,6 +45,13 @@ See the AUTHORS file for the corresponding full names. Changes through 1.9.9e did not credit all contributions; it is not possible to add this information. +20091227 + + change order of lookup in progs/tput.c, looking for terminfo data + first. This fixes a confusion between termcap "sg" and terminfo + "sgr" or "sgr0", originally from 990123 changes, but exposed by + 20091114 fixes for hashing. With this change, only "dl" and "ed" are + ambiguous (Mandriva #56272). + 20091226 + add bterm terminfo entry, based on bogl 0.1.18 -TD + minor fix to rxvt+pcfkeys terminfo entry -TD diff --git a/dist.mk b/dist.mk index 83c9bcfb..cd5990ec 100644 --- a/dist.mk +++ b/dist.mk @@ -25,7 +25,7 @@ # use or other dealings in this Software without prior written # # authorization. # ############################################################################## -# $Id: dist.mk,v 1.737 2009/12/26 15:25:42 tom Exp $ +# $Id: dist.mk,v 1.738 2009/12/27 15:45:50 tom Exp $ # Makefile for creating ncurses distributions. # # This only needs to be used directly as a makefile by developers, but @@ -37,7 +37,7 @@ SHELL = /bin/sh # These define the major/minor/patch versions of ncurses. NCURSES_MAJOR = 5 NCURSES_MINOR = 7 -NCURSES_PATCH = 20091226 +NCURSES_PATCH = 20091227 # We don't append the patch to the version, since this only applies to releases VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR) diff --git a/progs/tput.c b/progs/tput.c index 91b23857..149225d2 100644 --- a/progs/tput.c +++ b/progs/tput.c @@ -47,7 +47,7 @@ #endif #include -MODULE_ID("$Id: tput.c,v 1.43 2009/03/14 18:45:55 tom Exp $") +MODULE_ID("$Id: tput.c,v 1.45 2009/12/27 16:36:12 tom Exp $") #define PUTS(s) fputs(s, stdout) #define PUTCHAR(c) putchar(c) @@ -153,6 +153,9 @@ tput(int argc, char *argv[]) int i, j, c; int status; FILE *f; +#if !PURE_TERMINFO + bool termcap = FALSE; +#endif if ((name = argv[0]) == 0) name = ""; @@ -265,35 +268,40 @@ tput(int argc, char *argv[]) return 0; } #if !PURE_TERMINFO - { - const struct name_table_entry *np; - - if ((np = _nc_find_entry(name, _nc_get_hash_table(1))) != 0) - switch (np->nte_type) { - case BOOLEAN: - if (bool_from_termcap[np->nte_index]) - name = boolnames[np->nte_index]; - break; - - case NUMBER: - if (num_from_termcap[np->nte_index]) - name = numnames[np->nte_index]; - break; - - case STRING: - if (str_from_termcap[np->nte_index]) - name = strnames[np->nte_index]; - break; - } - } + retry: #endif - if ((status = tigetflag(name)) != -1) { return exit_code(BOOLEAN, status); } else if ((status = tigetnum(name)) != CANCELLED_NUMERIC) { (void) printf("%d\n", status); return exit_code(NUMBER, 0); } else if ((s = tigetstr(name)) == CANCELLED_STRING) { +#if !PURE_TERMINFO + if (!termcap) { + const struct name_table_entry *np; + + termcap = TRUE; + if ((np = _nc_find_entry(name, _nc_get_hash_table(termcap))) != 0) { + switch (np->nte_type) { + case BOOLEAN: + if (bool_from_termcap[np->nte_index]) + name = boolnames[np->nte_index]; + break; + + case NUMBER: + if (num_from_termcap[np->nte_index]) + name = numnames[np->nte_index]; + break; + + case STRING: + if (str_from_termcap[np->nte_index]) + name = strnames[np->nte_index]; + break; + } + goto retry; + } + } +#endif quit(4, "unknown terminfo capability '%s'", name); } else if (s != ABSENT_STRING) { if (argc > 1) {