]> ncurses.scripts.mit.edu Git - ncurses.git/commitdiff
ncurses 5.7 - patch 20091227
authorThomas E. Dickey <dickey@invisible-island.net>
Sun, 27 Dec 2009 16:59:25 +0000 (16:59 +0000)
committerThomas E. Dickey <dickey@invisible-island.net>
Sun, 27 Dec 2009 16:59:25 +0000 (16:59 +0000)
+ 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).

NEWS
dist.mk
progs/tput.c

diff --git a/NEWS b/NEWS
index a283351cbbfe133b18d4704257434df78cc8c230..a2038f45a46e182040696c1f15f4347692aba401 100644 (file)
--- 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 83c9bcfb587426c20e6d5bc0896b5f4f3ee59b57..cd5990ec1bfee1eac58b32e4c1e14e8ab487a2c8 100644 (file)
--- 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)
index 91b23857524c31fb3580bf50de33298cb4be9b99..149225d295c2251a1fb85971a11579a982ec23d9 100644 (file)
@@ -47,7 +47,7 @@
 #endif
 #include <transform.h>
 
-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) {