From: Thomas E. Dickey Date: Sun, 8 Apr 2012 00:45:28 +0000 (+0000) Subject: ncurses 5.9 - patch 20120407 X-Git-Tag: v6.0~159 X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=commitdiff_plain;h=18b7b94579f108e649ece3fb12165833dbf5d95a;ds=sidebyside ncurses 5.9 - patch 20120407 + fix an inconsistency between tic/infocmp "-x" option; tic omits all non-standard capabilities, while infocmp was ignoring only the user definable capabilities. + improve special case in tic parsing of description to allow it to be followed by terminfo capabilities. Previously the description had to be the last field on an input line to allow tic to distinguish between termcap and terminfo format while still allowing commas to be embedded in the description. + correct variable name in gen_edit.sh which broke configurability of the --with-xterm-kbs option. + revert 2011-07-16 change to "linux" alias, return to "linux2.2" -TD + further amend 20110910 change, providing for configure-script override of the "linux" terminfo entry to install and changing the default for that to "linux2.2" (Debian #665959). --- diff --git a/NEWS b/NEWS index 386cb399..06f1c828 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.1885 2012/03/31 23:10:23 tom Exp $ +-- $Id: NEWS,v 1.1891 2012/04/07 19:17:36 tom Exp $ ------------------------------------------------------------------------------- This is a log of changes that ncurses has gone through since Zeyd started @@ -45,6 +45,22 @@ 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. +20120407 + + fix an inconsistency between tic/infocmp "-x" option; tic omits all + non-standard capabilities, while infocmp was ignoring only the user + definable capabilities. + + improve special case in tic parsing of description to allow it to be + followed by terminfo capabilities. Previously the description had to + be the last field on an input line to allow tic to distinguish + between termcap and terminfo format while still allowing commas to be + embedded in the description. + + correct variable name in gen_edit.sh which broke configurability of + the --with-xterm-kbs option. + + revert 2011-07-16 change to "linux" alias, return to "linux2.2" -TD + + further amend 20110910 change, providing for configure-script + override of the "linux" terminfo entry to install and changing the + default for that to "linux2.2" (Debian #665959). + 20120331 + update Ada95/configure to use CF_DISABLE_ECHO (cf: 20120317). + correct order of use-clauses in st-256color -TD diff --git a/dist.mk b/dist.mk index 0fe00524..bebac9ac 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.866 2012/03/31 15:04:31 tom Exp $ +# $Id: dist.mk,v 1.868 2012/04/07 15:24:19 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 = 9 -NCURSES_PATCH = 20120331 +NCURSES_PATCH = 20120407 # We don't append the patch to the version, since this only applies to releases VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR) diff --git a/misc/gen_edit.sh b/misc/gen_edit.sh index 49557111..3460afcd 100755 --- a/misc/gen_edit.sh +++ b/misc/gen_edit.sh @@ -29,7 +29,7 @@ # # Author: Thomas E. Dickey # -# $Id: gen_edit.sh,v 1.4 2012/02/11 16:30:03 tom Exp $ +# $Id: gen_edit.sh,v 1.5 2012/04/01 15:04:37 tom Exp $ # Generate a sed-script for converting the terminfo.src to the form which will # be installed. # @@ -37,9 +37,12 @@ # The leaf directory names (lib, tabset, terminfo) # -: ${datadir=@datadir@} -: ${xterm_new=@WHICH_XTERM@} -: ${xterm_kbs=@XTERM_KBS@} +linux_dft=linux2.2 + +: ${datadir=/usr/share} +: ${WHICH_LINUX=$linux_dft} +: ${WHICH_XTERM=xterm-new} +: ${XTERM_KBS=BS} # If we're not installing into /usr/share/, we'll have to adjust the location # of the tabset files in terminfo.src (which are in a parallel directory). @@ -50,7 +53,8 @@ s%/usr/share/tabset%$TABSET%g EOF fi -if test "$xterm_new" != "xterm-new" ; then +if test "$WHICH_XTERM" != "xterm-new" ; then +echo "** using $WHICH_XTERM terminal description for XTerm entry" >&2 cat <&2 cat </dev/null` -if test "x$system" = xLinux +# kernels do not recognize those controls. All of the kernels recognize the +# older flavor of rmacs/smacs, but beginning in the late 1990s, changes made +# as part of implementing UTF-8 prevent using those for line-drawing when the +# console is in UTF-8 mode. Taking into account the fact that it took about +# ten years to provide (and distribute) the 2.6 series' change for SI/SO, the +# default remains "linux2.2". +case x$WHICH_LINUX in #(vi +xauto) + system=`uname -s 2>/dev/null` + if test "x$system" = xLinux + then + case x`uname -r` in + x1.*) + WHICH_LINUX=linux-c + ;; + x2.[0-4]*) + WHICH_LINUX=linux2.2 + ;; + *) + WHICH_LINUX=linux3.0 + ;; + esac + else + WHICH_LINUX=$linux_dft + fi + ;; +xlinux*) + # allow specific setting + ;; +*) + WHICH_LINUX=$linux_dft + ;; +esac + +if test $WHICH_LINUX != $linux_dft then - case x`uname -r` in - x1.*) -cat <&2 cat < #include -MODULE_ID("$Id: comp_scan.c,v 1.97 2012/03/24 22:24:19 tom Exp $") +MODULE_ID("$Id: comp_scan.c,v 1.99 2012/04/01 20:37:08 tom Exp $") /* * Maximum length of string capability we'll accept before raising an error. @@ -128,14 +128,19 @@ _nc_reset_input(FILE *fp, char *buf) * Returns the final nonblank character on the current input buffer */ static int -last_char(void) +last_char(int from_end) { size_t len = strlen(bufptr); + int result = 0; + while (len--) { - if (!isspace(UChar(bufptr[len]))) - return bufptr[len]; + if (!isspace(UChar(bufptr[len]))) { + if (from_end < (int) len) + result = bufptr[(int) len - from_end]; + break; + } } - return 0; + return result; } /* @@ -341,13 +346,13 @@ _nc_get_token(bool silent) { static const char terminfo_punct[] = "@%&*!#"; - char *after_list; - char *after_name; + char *after_name; /* after primary name */ + char *after_list; /* after primary and alias list */ char *numchk; char *tok_ptr; char *s; char numbuf[80]; - int ch; + int ch, c0, c1; int dot_flag = FALSE; int type; long number; @@ -460,7 +465,7 @@ _nc_get_token(bool silent) after_list = tok_ptr; if (after_name == 0) after_name = tok_ptr; - } else if (ch == ':' && last_char() != ',') { + } else if (ch == ':' && last_char(0) != ',') { _nc_syntax = SYN_TERMCAP; separator = ':'; break; @@ -474,12 +479,64 @@ _nc_get_token(bool silent) if (after_name == 0) break; /* - * If we see a comma, we assume this is terminfo unless we - * subsequently run into a colon. But we don't stop - * looking for a colon until hitting a newline. This - * allows commas to be embedded in description fields of - * either syntax. + * We saw a comma, but are not entirely sure this is + * terminfo format, since we can still be parsing the + * description field (for either syntax). + * + * A properly formatted termcap line ends with either a + * colon, or a backslash after a colon. It is possible + * to have a backslash in the middle of a capability, but + * then there would be no leading whitespace on the next + * line - something we want to discourage. */ + c0 = last_char(0); + c1 = last_char(1); + if (c1 != ':' && c0 != '\\' && c0 != ':') { + bool capability = FALSE; + + /* + * Since it is not termcap, assume the line is terminfo + * format. However, the comma can be embedded in a + * description field. It also can be a separator + * between a description field and a capability. + * + * Improve the guess by checking if the next word after + * the comma does not look like a capability. In that + * case, extend the description past the comma. + */ + for (s = bufptr; isspace(UChar(*s)); ++s) { + ; + } + if (islower(UChar(*s))) { + char *name = s; + while (isalnum(UChar(*s))) { + ++s; + } + if (*s == '#' || *s == '=' || *s == '@') { + /* + * Checking solely with syntax allows us to + * support extended capabilities with string + * values. + */ + capability = TRUE; + } else if (*s == ',') { + c0 = *s; + *s = '\0'; + /* + * Otherwise, we can handle predefined boolean + * capabilities, still aided by syntax. + */ + if (_nc_find_entry(name, + _nc_get_hash_table(FALSE))) { + capability = TRUE; + } + *s = c0; + } + } + if (capability) { + break; + } + } } else ch = eat_escaped_newline(ch); diff --git a/progs/infocmp.c b/progs/infocmp.c index 4f0323aa..2e6f67a8 100644 --- a/progs/infocmp.c +++ b/progs/infocmp.c @@ -42,7 +42,7 @@ #include -MODULE_ID("$Id: infocmp.c,v 1.114 2012/03/11 00:10:57 tom Exp $") +MODULE_ID("$Id: infocmp.c,v 1.115 2012/04/07 19:12:01 tom Exp $") #define L_CURL "{" #define R_CURL "}" @@ -333,6 +333,21 @@ dump_string(char *val, char *buf) } } +/* + * ncurses stores two types of non-standard capabilities: + * a) capabilities listed past the "STOP-HERE" comment in the Caps file. + * These are used in the terminfo source file to provide data for termcaps, + * e.g., when there is no equivalent capability in terminfo, as well as for + * widely-used non-standard capabilities. + * b) user-definable capabilities, via "tic -x". + * + * However, if "-x" is omitted from the tic command, both types of + * non-standard capability are not loaded into the terminfo database. This + * macro is used for limit-checks against the symbols that tic uses to omit + * the two types of non-standard entry. + */ +#define check_user_definable(n,limit) if (!_nc_user_definable && (n) > (limit)) break + static void compare_predicate(PredType type, PredIdx idx, const char *name) /* predicate function to use for entry difference reports */ @@ -346,6 +361,7 @@ compare_predicate(PredType type, PredIdx idx, const char *name) switch (type) { case CMP_BOOLEAN: + check_user_definable(idx, BOOLWRITE); b1 = e1->tterm.Booleans[idx]; b2 = e2->tterm.Booleans[idx]; switch (compare) { @@ -371,6 +387,7 @@ compare_predicate(PredType type, PredIdx idx, const char *name) break; case CMP_NUMBER: + check_user_definable(idx, NUMWRITE); n1 = e1->tterm.Numbers[idx]; n2 = e2->tterm.Numbers[idx]; dump_numeric(n1, buf1); @@ -394,6 +411,7 @@ compare_predicate(PredType type, PredIdx idx, const char *name) break; case CMP_STRING: + check_user_definable(idx, STRWRITE); s1 = e1->tterm.Strings[idx]; s2 = e2->tterm.Strings[idx]; switch (compare) {