]> ncurses.scripts.mit.edu Git - ncurses.git/commitdiff
ncurses 5.9 - patch 20110730
authorThomas E. Dickey <dickey@invisible-island.net>
Sun, 31 Jul 2011 01:15:59 +0000 (01:15 +0000)
committerThomas E. Dickey <dickey@invisible-island.net>
Sun, 31 Jul 2011 01:15:59 +0000 (01:15 +0000)
+ modify configure script and makefiles in c++ and progs to allow the
  directory used for rpath option to be overridden, e.g., to work
  around updates to the variables used by tic during an install.
+ add -K option to tic/infocmp, to provide stricter BSD-compatibility
  for termcap output.
+ add _nc_strict_bsd variable in tic library which controls the
  "strict" BSD termcap compatibility from 20110723, plus these
  features:
  + allow escapes such as "\8" and "\9" when reading termcap
  + disallow "\a", "\e", "\l", "\s" and "\:" escapes when reading
    termcap files, passing through "a", "e", etc.
  + expand "\:" as "\072" on output.
+ modify _nc_get_token() to reset the token's string value in case
  there is a string-typed token lacking the "=" marker.
+ fix a few memory leaks in _nc_tgetent.
+ fix a few places where reading from a termcap file could refer to
  freed memory.
+ add an overflow check when converting terminfo/termcap numeric
  values, since terminfo stores those in a short, and they must be
  positive.
+ correct internal variables used for translating to termcap "%>"
  feature, and translating from termcap %B to terminfo, needed by
  tctest (cf: 19991211).
+ amend a minor fix to acsc when loading a termcap file to separate it
  from warnings needed for tic (cf: 20040710)
+ modify logic in _nc_read_entry() and _nc_read_tic_entry() to allow
  a termcap file to be handled via TERMINFO_DIRS.
+ modify _nc_infotocap() to include non-mandatory padding when
  translating to termcap.
+ modify _nc_read_termcap_entry(), passing a flag in the case where
  getcap is used, to reduce interactive warning messages.

24 files changed:
Ada95/aclocal.m4
Ada95/configure
INSTALL
NEWS
aclocal.m4
c++/Makefile.in
configure
dist.mk
include/tic.h
man/infocmp.1m
man/ncurses.3x
man/terminfo.tail
man/tic.1m
ncurses/curses.priv.h
ncurses/tinfo/captoinfo.c
ncurses/tinfo/comp_error.c
ncurses/tinfo/comp_parse.c
ncurses/tinfo/comp_scan.c
ncurses/tinfo/parse_entry.c
ncurses/tinfo/read_entry.c
ncurses/tinfo/read_termcap.c
progs/Makefile.in
progs/infocmp.c
progs/tic.c

index cc2ecfc921d74d16fcd39ceaec5dc7f3ad05247d..6be9319f3fe1aaeb99800d5340d56ff87df557af 100644 (file)
@@ -28,7 +28,7 @@ dnl***************************************************************************
 dnl
 dnl Author: Thomas E. Dickey
 dnl
-dnl $Id: aclocal.m4,v 1.34 2011/07/17 18:54:59 tom Exp $
+dnl $Id: aclocal.m4,v 1.35 2011/07/30 23:33:10 tom Exp $
 dnl Macros used in NCURSES Ada95 auto-configuration script.
 dnl
 dnl These macros are maintained separately from NCURSES.  The copyright on
@@ -2942,7 +2942,7 @@ define([CF_REMOVE_LIB],
 $1=`echo "$2" | sed -e 's/-l$3[[       ]]//g' -e 's/-l$3[$]//'`
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_SHARED_OPTS version: 68 updated: 2011/07/17 14:48:41
+dnl CF_SHARED_OPTS version: 69 updated: 2011/07/30 19:31:39
 dnl --------------
 dnl --------------
 dnl Attempt to determine the appropriate CC/LD options for creating a shared
@@ -3020,11 +3020,11 @@ AC_DEFUN([CF_SHARED_OPTS],
        aix4.[3-9]*|aix[[5-7]]*) #(vi
                if test "$GCC" = yes; then
                        CC_SHARED_OPTS=
-                       MK_SHARED_LIB='${CC} -shared -Wl,-brtl -Wl,-blibpath:${libdir}:/usr/lib -o [$]@'
+                       MK_SHARED_LIB='${CC} -shared -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o [$]@'
                else
                        # CC_SHARED_OPTS='-qpic=large -G'
                        # perhaps "-bM:SRE -bnoentry -bexpall"
-                       MK_SHARED_LIB='${CC} -G -Wl,-brtl -Wl,-blibpath:${libdir}:/usr/lib -o [$]@'
+                       MK_SHARED_LIB='${CC} -G -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o [$]@'
                fi
                ;;
        beos*) #(vi
@@ -3085,11 +3085,11 @@ CF_EOF
                        cf_shared_soname='`basename $@`'
                fi
                CC_SHARED_OPTS=
-               MK_SHARED_LIB='${CC} -shared -Wl,-rpath,${libdir} -Wl,-h,'$cf_shared_soname' -o $@'
+               MK_SHARED_LIB='${CC} -shared -Wl,-rpath,${RPATH_LIST} -Wl,-h,'$cf_shared_soname' -o $@'
                ;;
        irix*) #(vi
                if test "$cf_cv_enable_rpath" = yes ; then
-                       EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
+                       EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
                fi
                # tested with IRIX 5.2 and 'cc'.
                if test "$GCC" != yes; then
@@ -3106,7 +3106,7 @@ CF_EOF
                        LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
                fi
                if test "$cf_cv_enable_rpath" = yes ; then
-                       EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
+                       EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
                fi
                CF_SHARED_SONAME
                MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $[@]'
@@ -3117,7 +3117,7 @@ CF_EOF
                        LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
                fi
                if test "$cf_cv_enable_rpath" = yes ; then
-                       EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
+                       EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
                fi
                CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
                CF_SHARED_SONAME
@@ -3132,8 +3132,8 @@ CF_EOF
                CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
                if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
                        LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
-                       LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${libdir} $LOCAL_LDFLAGS"
-                       EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
+                       LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${RPATH_LIST} $LOCAL_LDFLAGS"
+                       EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
                fi
                CF_SHARED_SONAME
                MK_SHARED_LIB='${LD} -shared -Bshareable -soname=`basename $[@]` -o $[@]'
@@ -3143,7 +3143,7 @@ CF_EOF
                if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
                        LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
                        LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
-                       EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
+                       EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
                        if test "$cf_cv_shlib_version" = auto; then
                        if test -f /usr/libexec/ld.elf_so; then
                                cf_cv_shlib_version=abi
@@ -3248,9 +3248,9 @@ CF_EOF
                ;;
        esac
 
-       if test -n "$cf_ld_rpath_opt" ; then
-               MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${libdir}"
-       fi
+       # RPATH_LIST is a colon-separated list of directories
+       test -n "$cf_ld_rpath_opt" && MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${RPATH_LIST}"
+       test -z "$RPATH_LIST" && RPATH_LIST="\${libdir}"
 
        AC_SUBST(CC_SHARED_OPTS)
        AC_SUBST(LD_RPATH_OPT)
@@ -3262,6 +3262,7 @@ CF_EOF
        AC_SUBST(LOCAL_LDFLAGS)
        AC_SUBST(LOCAL_LDFLAGS2)
        AC_SUBST(INSTALL_LIB)
+       AC_SUBST(RPATH_LIST)
 ])dnl
 dnl ---------------------------------------------------------------------------
 dnl CF_SHARED_SONAME version: 3 updated: 2008/09/08 18:34:43
index 1a3b7b67ecac9595f2ed48745ef264398b268f3a..3d9dd78cfe2d935c22e6cb2396878170ba97e865 100644 (file)
@@ -7575,11 +7575,11 @@ echo "${ECHO_T}$CC_SHARED_OPTS" >&6
        aix4.3-9*|aix[5-7]*) #(vi
                if test "$GCC" = yes; then
                        CC_SHARED_OPTS=
-                       MK_SHARED_LIB='${CC} -shared -Wl,-brtl -Wl,-blibpath:${libdir}:/usr/lib -o $@'
+                       MK_SHARED_LIB='${CC} -shared -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
                else
                        # CC_SHARED_OPTS='-qpic=large -G'
                        # perhaps "-bM:SRE -bnoentry -bexpall"
-                       MK_SHARED_LIB='${CC} -G -Wl,-brtl -Wl,-blibpath:${libdir}:/usr/lib -o $@'
+                       MK_SHARED_LIB='${CC} -G -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
                fi
                ;;
        beos*) #(vi
@@ -7678,11 +7678,11 @@ echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
                        cf_shared_soname='`basename `'
                fi
                CC_SHARED_OPTS=
-               MK_SHARED_LIB='${CC} -shared -Wl,-rpath,${libdir} -Wl,-h,'$cf_shared_soname' -o '
+               MK_SHARED_LIB='${CC} -shared -Wl,-rpath,${RPATH_LIST} -Wl,-h,'$cf_shared_soname' -o '
                ;;
        irix*) #(vi
                if test "$cf_cv_enable_rpath" = yes ; then
-                       EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
+                       EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
                fi
                # tested with IRIX 5.2 and 'cc'.
                if test "$GCC" != yes; then
@@ -7699,7 +7699,7 @@ echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
                        LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
                fi
                if test "$cf_cv_enable_rpath" = yes ; then
-                       EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
+                       EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
                fi
 
        test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
@@ -7717,7 +7717,7 @@ echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
                        LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
                fi
                if test "$cf_cv_enable_rpath" = yes ; then
-                       EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
+                       EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
                fi
                CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
 
@@ -7739,8 +7739,8 @@ echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
                CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
                if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
                        LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
-                       LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${libdir} $LOCAL_LDFLAGS"
-                       EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
+                       LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${RPATH_LIST} $LOCAL_LDFLAGS"
+                       EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
                fi
 
        test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
@@ -7757,7 +7757,7 @@ echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
                if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
                        LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
                        LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
-                       EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
+                       EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
                        if test "$cf_cv_shlib_version" = auto; then
                        if test -f /usr/libexec/ld.elf_so; then
                                cf_cv_shlib_version=abi
@@ -7906,9 +7906,9 @@ echo "$as_me: WARNING: ignored --with-shlib-version" >&2;}
                ;;
        esac
 
-       if test -n "$cf_ld_rpath_opt" ; then
-               MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${libdir}"
-       fi
+       # RPATH_LIST is a colon-separated list of directories
+       test -n "$cf_ld_rpath_opt" && MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${RPATH_LIST}"
+       test -z "$RPATH_LIST" && RPATH_LIST="\${libdir}"
 
 # The test/sample programs in the original tree link using rpath option.
 # Make it optional for packagers.
@@ -12233,6 +12233,7 @@ s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
 s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t
 s,@INSTALL_LIB@,$INSTALL_LIB,;t t
+s,@RPATH_LIST@,$RPATH_LIST,;t t
 s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t
 s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t
 s,@NCURSES_CONST@,$NCURSES_CONST,;t t
@@ -12387,7 +12388,7 @@ done; }
   esac
 
   if test x"$ac_file" != x-; then
-    { echo "$as_me:12390: creating $ac_file" >&5
+    { echo "$as_me:12391: creating $ac_file" >&5
 echo "$as_me: creating $ac_file" >&6;}
     rm -f "$ac_file"
   fi
@@ -12405,7 +12406,7 @@ echo "$as_me: creating $ac_file" >&6;}
       -) echo $tmp/stdin ;;
       [\\/$]*)
          # Absolute (can't be DOS-style, as IFS=:)
-         test -f "$f" || { { echo "$as_me:12408: error: cannot find input file: $f" >&5
+         test -f "$f" || { { echo "$as_me:12409: error: cannot find input file: $f" >&5
 echo "$as_me: error: cannot find input file: $f" >&2;}
    { (exit 1); exit 1; }; }
          echo $f;;
@@ -12418,7 +12419,7 @@ echo "$as_me: error: cannot find input file: $f" >&2;}
            echo $srcdir/$f
          else
            # /dev/null tree
-           { { echo "$as_me:12421: error: cannot find input file: $f" >&5
+           { { echo "$as_me:12422: error: cannot find input file: $f" >&5
 echo "$as_me: error: cannot find input file: $f" >&2;}
    { (exit 1); exit 1; }; }
          fi;;
@@ -12484,7 +12485,7 @@ for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
   * )   ac_file_in=$ac_file.in ;;
   esac
 
-  test x"$ac_file" != x- && { echo "$as_me:12487: creating $ac_file" >&5
+  test x"$ac_file" != x- && { echo "$as_me:12488: creating $ac_file" >&5
 echo "$as_me: creating $ac_file" >&6;}
 
   # First look for the input files in the build tree, otherwise in the
@@ -12495,7 +12496,7 @@ echo "$as_me: creating $ac_file" >&6;}
       -) echo $tmp/stdin ;;
       [\\/$]*)
          # Absolute (can't be DOS-style, as IFS=:)
-         test -f "$f" || { { echo "$as_me:12498: error: cannot find input file: $f" >&5
+         test -f "$f" || { { echo "$as_me:12499: error: cannot find input file: $f" >&5
 echo "$as_me: error: cannot find input file: $f" >&2;}
    { (exit 1); exit 1; }; }
          echo $f;;
@@ -12508,7 +12509,7 @@ echo "$as_me: error: cannot find input file: $f" >&2;}
            echo $srcdir/$f
          else
            # /dev/null tree
-           { { echo "$as_me:12511: error: cannot find input file: $f" >&5
+           { { echo "$as_me:12512: error: cannot find input file: $f" >&5
 echo "$as_me: error: cannot find input file: $f" >&2;}
    { (exit 1); exit 1; }; }
          fi;;
@@ -12566,7 +12567,7 @@ cat >>$CONFIG_STATUS <<\EOF
   rm -f $tmp/in
   if test x"$ac_file" != x-; then
     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
-      { echo "$as_me:12569: $ac_file is unchanged" >&5
+      { echo "$as_me:12570: $ac_file is unchanged" >&5
 echo "$as_me: $ac_file is unchanged" >&6;}
     else
       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
diff --git a/INSTALL b/INSTALL
index d4d1e881449eab711faa2a632493f52155723856..0a039669cdc03910a0e1d57d67f0d3d5b3010240 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -25,7 +25,7 @@
 -- sale, use or other dealings in this Software without prior written        --
 -- authorization.                                                            --
 -------------------------------------------------------------------------------
--- $Id: INSTALL,v 1.156 2011/05/07 19:39:37 tom Exp $
+-- $Id: INSTALL,v 1.157 2011/07/24 13:43:43 tom Exp $
 ---------------------------------------------------------------------
              How to install Ncurses/Terminfo on your system
 ---------------------------------------------------------------------
@@ -616,6 +616,12 @@ SUMMARY OF CONFIGURE OPTIONS:
        match is found in the terminfo database.  See also the --enable-getcap
        and --enable-getcap-cache options.
 
+       Termcap support requires run-time parsing rather than loading
+       predigested data.  If you have specified --with-ticlib, then you
+       cannot have termcap support since run-time parsing is done in the
+       tic library, which is intentionally not part of normal linkage
+       dependencies.
+
     --enable-warnings
        Turn on GCC compiler warnings.  There should be only a few.
 
diff --git a/NEWS b/NEWS
index de116f0b34ccf14c53e8f61559b42c331615810e..a054641523923bc7a7c8576247e601bd2ff8d834 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.1743 2011/07/23 22:02:25 tom Exp $
+-- $Id: NEWS,v 1.1755 2011/07/30 22:57:54 tom Exp $
 -------------------------------------------------------------------------------
 
 This is a log of changes that ncurses has gone through since Zeyd started
@@ -45,6 +45,39 @@ 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.
 
+20110730
+       + modify configure script and makefiles in c++ and progs to allow the
+         directory used for rpath option to be overridden, e.g., to work
+         around updates to the variables used by tic during an install.
+       + add -K option to tic/infocmp, to provide stricter BSD-compatibility
+         for termcap output.
+       + add _nc_strict_bsd variable in tic library which controls the
+         "strict" BSD termcap compatibility from 20110723, plus these
+         features:
+         + allow escapes such as "\8" and "\9" when reading termcap
+         + disallow "\a", "\e", "\l", "\s" and "\:" escapes when reading
+           termcap files, passing through "a", "e", etc.
+         + expand "\:" as "\072" on output.
+       + modify _nc_get_token() to reset the token's string value in case
+         there is a string-typed token lacking the "=" marker.
+       + fix a few memory leaks in _nc_tgetent.
+       + fix a few places where reading from a termcap file could refer to
+         freed memory.
+       + add an overflow check when converting terminfo/termcap numeric
+         values, since terminfo stores those in a short, and they must be
+         positive.
+       + correct internal variables used for translating to termcap "%>"
+         feature, and translating from termcap %B to terminfo, needed by
+         tctest (cf: 19991211).
+       + amend a minor fix to acsc when loading a termcap file to separate it
+         from warnings needed for tic (cf: 20040710)
+       + modify logic in _nc_read_entry() and _nc_read_tic_entry() to allow
+         a termcap file to be handled via TERMINFO_DIRS.
+       + modify _nc_infotocap() to include non-mandatory padding when
+         translating to termcap.
+       + modify _nc_read_termcap_entry(), passing a flag in the case where
+         getcap is used, to reduce interactive warning messages.
+
 20110723
        + add a check in start_color() to limit color-pairs to 256 when
          extended colors are not supported (patch by David Benjamin).
index 18e2491c92133d60547936227206a57a6d506937..ce5aa01b617e966d94511468ad667172a1e69537 100644 (file)
@@ -28,7 +28,7 @@ dnl***************************************************************************
 dnl
 dnl Author: Thomas E. Dickey 1995-on
 dnl
-dnl $Id: aclocal.m4,v 1.563 2011/07/17 18:55:21 tom Exp $
+dnl $Id: aclocal.m4,v 1.564 2011/07/30 23:32:32 tom Exp $
 dnl Macros used in NCURSES auto-configuration script.
 dnl
 dnl These macros are maintained separately from NCURSES.  The copyright on
@@ -5118,7 +5118,7 @@ CF_VERBOSE(...checked $1 [$]$1)
 AC_SUBST(EXTRA_LDFLAGS)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_SHARED_OPTS version: 68 updated: 2011/07/17 14:48:41
+dnl CF_SHARED_OPTS version: 69 updated: 2011/07/30 19:31:39
 dnl --------------
 dnl --------------
 dnl Attempt to determine the appropriate CC/LD options for creating a shared
@@ -5196,11 +5196,11 @@ AC_DEFUN([CF_SHARED_OPTS],
        aix4.[3-9]*|aix[[5-7]]*) #(vi
                if test "$GCC" = yes; then
                        CC_SHARED_OPTS=
-                       MK_SHARED_LIB='${CC} -shared -Wl,-brtl -Wl,-blibpath:${libdir}:/usr/lib -o [$]@'
+                       MK_SHARED_LIB='${CC} -shared -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o [$]@'
                else
                        # CC_SHARED_OPTS='-qpic=large -G'
                        # perhaps "-bM:SRE -bnoentry -bexpall"
-                       MK_SHARED_LIB='${CC} -G -Wl,-brtl -Wl,-blibpath:${libdir}:/usr/lib -o [$]@'
+                       MK_SHARED_LIB='${CC} -G -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o [$]@'
                fi
                ;;
        beos*) #(vi
@@ -5261,11 +5261,11 @@ CF_EOF
                        cf_shared_soname='`basename $@`'
                fi
                CC_SHARED_OPTS=
-               MK_SHARED_LIB='${CC} -shared -Wl,-rpath,${libdir} -Wl,-h,'$cf_shared_soname' -o $@'
+               MK_SHARED_LIB='${CC} -shared -Wl,-rpath,${RPATH_LIST} -Wl,-h,'$cf_shared_soname' -o $@'
                ;;
        irix*) #(vi
                if test "$cf_cv_enable_rpath" = yes ; then
-                       EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
+                       EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
                fi
                # tested with IRIX 5.2 and 'cc'.
                if test "$GCC" != yes; then
@@ -5282,7 +5282,7 @@ CF_EOF
                        LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
                fi
                if test "$cf_cv_enable_rpath" = yes ; then
-                       EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
+                       EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
                fi
                CF_SHARED_SONAME
                MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $[@]'
@@ -5293,7 +5293,7 @@ CF_EOF
                        LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
                fi
                if test "$cf_cv_enable_rpath" = yes ; then
-                       EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
+                       EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
                fi
                CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
                CF_SHARED_SONAME
@@ -5308,8 +5308,8 @@ CF_EOF
                CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
                if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
                        LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
-                       LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${libdir} $LOCAL_LDFLAGS"
-                       EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
+                       LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${RPATH_LIST} $LOCAL_LDFLAGS"
+                       EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
                fi
                CF_SHARED_SONAME
                MK_SHARED_LIB='${LD} -shared -Bshareable -soname=`basename $[@]` -o $[@]'
@@ -5319,7 +5319,7 @@ CF_EOF
                if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
                        LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
                        LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
-                       EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
+                       EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
                        if test "$cf_cv_shlib_version" = auto; then
                        if test -f /usr/libexec/ld.elf_so; then
                                cf_cv_shlib_version=abi
@@ -5424,9 +5424,9 @@ CF_EOF
                ;;
        esac
 
-       if test -n "$cf_ld_rpath_opt" ; then
-               MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${libdir}"
-       fi
+       # RPATH_LIST is a colon-separated list of directories
+       test -n "$cf_ld_rpath_opt" && MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${RPATH_LIST}"
+       test -z "$RPATH_LIST" && RPATH_LIST="\${libdir}"
 
        AC_SUBST(CC_SHARED_OPTS)
        AC_SUBST(LD_RPATH_OPT)
@@ -5438,6 +5438,7 @@ CF_EOF
        AC_SUBST(LOCAL_LDFLAGS)
        AC_SUBST(LOCAL_LDFLAGS2)
        AC_SUBST(INSTALL_LIB)
+       AC_SUBST(RPATH_LIST)
 ])dnl
 dnl ---------------------------------------------------------------------------
 dnl CF_SHARED_SONAME version: 3 updated: 2008/09/08 18:34:43
index fa2023c3c51ac81f29f687925b642ee4a8fdae27..889829c97fce35b88e2f46355f7ca08f10772f53 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: Makefile.in,v 1.94 2011/07/02 18:04:05 tom Exp $
+# $Id: Makefile.in,v 1.95 2011/07/30 22:52:07 tom Exp $
 ##############################################################################
 # Copyright (c) 1998-2010,2011 Free Software Foundation, Inc.                #
 #                                                                            #
@@ -112,6 +112,7 @@ LIBNAME             = @LIB_PREFIX@$(LIBROOT)@CXX_LIB_SUFFIX@
 MY_LIBRARY     = ../lib/$(LIBNAME)
 
 LINK_FLAGS     = @EXTRA_LDFLAGS@ -L../lib -l$(LIBROOT)@LIB_SUFFIX@
+RPATH_LIST     = @RPATH_LIST@
 
 LINK_LIBTOOL   = @EXTRA_LDFLAGS@ -L../lib $(MY_LIBRARY)
 LINK_NORMAL    = $(LINK_FLAGS)
index bfc628e2b20b3ec19b79348b08d107dad313c018..6c2197b0d3a46836ce66bfc886ed5e19070636ed 100755 (executable)
--- a/configure
+++ b/configure
@@ -5699,11 +5699,11 @@ echo "${ECHO_T}$CC_SHARED_OPTS" >&6
        aix4.3-9*|aix[5-7]*) #(vi
                if test "$GCC" = yes; then
                        CC_SHARED_OPTS=
-                       MK_SHARED_LIB='${CC} -shared -Wl,-brtl -Wl,-blibpath:${libdir}:/usr/lib -o $@'
+                       MK_SHARED_LIB='${CC} -shared -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
                else
                        # CC_SHARED_OPTS='-qpic=large -G'
                        # perhaps "-bM:SRE -bnoentry -bexpall"
-                       MK_SHARED_LIB='${CC} -G -Wl,-brtl -Wl,-blibpath:${libdir}:/usr/lib -o $@'
+                       MK_SHARED_LIB='${CC} -G -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
                fi
                ;;
        beos*) #(vi
@@ -5802,11 +5802,11 @@ echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
                        cf_shared_soname='`basename `'
                fi
                CC_SHARED_OPTS=
-               MK_SHARED_LIB='${CC} -shared -Wl,-rpath,${libdir} -Wl,-h,'$cf_shared_soname' -o '
+               MK_SHARED_LIB='${CC} -shared -Wl,-rpath,${RPATH_LIST} -Wl,-h,'$cf_shared_soname' -o '
                ;;
        irix*) #(vi
                if test "$cf_cv_enable_rpath" = yes ; then
-                       EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
+                       EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
                fi
                # tested with IRIX 5.2 and 'cc'.
                if test "$GCC" != yes; then
@@ -5823,7 +5823,7 @@ echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
                        LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
                fi
                if test "$cf_cv_enable_rpath" = yes ; then
-                       EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
+                       EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
                fi
 
        test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
@@ -5841,7 +5841,7 @@ echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
                        LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
                fi
                if test "$cf_cv_enable_rpath" = yes ; then
-                       EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
+                       EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
                fi
                CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
 
@@ -5863,8 +5863,8 @@ echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
                CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
                if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
                        LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
-                       LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${libdir} $LOCAL_LDFLAGS"
-                       EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
+                       LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${RPATH_LIST} $LOCAL_LDFLAGS"
+                       EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
                fi
 
        test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
@@ -5881,7 +5881,7 @@ echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
                if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
                        LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
                        LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
-                       EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
+                       EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
                        if test "$cf_cv_shlib_version" = auto; then
                        if test -f /usr/libexec/ld.elf_so; then
                                cf_cv_shlib_version=abi
@@ -6030,9 +6030,9 @@ echo "$as_me: WARNING: ignored --with-shlib-version" >&2;}
                ;;
        esac
 
-       if test -n "$cf_ld_rpath_opt" ; then
-               MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${libdir}"
-       fi
+       # RPATH_LIST is a colon-separated list of directories
+       test -n "$cf_ld_rpath_opt" && MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${RPATH_LIST}"
+       test -z "$RPATH_LIST" && RPATH_LIST="\${libdir}"
 
 if test "$CC_SHARED_OPTS" = "unknown"; then
        for model in $cf_list_models; do
@@ -20194,6 +20194,7 @@ s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
 s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t
 s,@INSTALL_LIB@,$INSTALL_LIB,;t t
+s,@RPATH_LIST@,$RPATH_LIST,;t t
 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
 s,@TERMINFO_SRC@,$TERMINFO_SRC,;t t
 s,@FALLBACK_LIST@,$FALLBACK_LIST,;t t
@@ -20420,7 +20421,7 @@ done; }
   esac
 
   if test x"$ac_file" != x-; then
-    { echo "$as_me:20423: creating $ac_file" >&5
+    { echo "$as_me:20424: creating $ac_file" >&5
 echo "$as_me: creating $ac_file" >&6;}
     rm -f "$ac_file"
   fi
@@ -20438,7 +20439,7 @@ echo "$as_me: creating $ac_file" >&6;}
       -) echo $tmp/stdin ;;
       [\\/$]*)
          # Absolute (can't be DOS-style, as IFS=:)
-         test -f "$f" || { { echo "$as_me:20441: error: cannot find input file: $f" >&5
+         test -f "$f" || { { echo "$as_me:20442: error: cannot find input file: $f" >&5
 echo "$as_me: error: cannot find input file: $f" >&2;}
    { (exit 1); exit 1; }; }
          echo $f;;
@@ -20451,7 +20452,7 @@ echo "$as_me: error: cannot find input file: $f" >&2;}
            echo $srcdir/$f
          else
            # /dev/null tree
-           { { echo "$as_me:20454: error: cannot find input file: $f" >&5
+           { { echo "$as_me:20455: error: cannot find input file: $f" >&5
 echo "$as_me: error: cannot find input file: $f" >&2;}
    { (exit 1); exit 1; }; }
          fi;;
@@ -20517,7 +20518,7 @@ for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
   * )   ac_file_in=$ac_file.in ;;
   esac
 
-  test x"$ac_file" != x- && { echo "$as_me:20520: creating $ac_file" >&5
+  test x"$ac_file" != x- && { echo "$as_me:20521: creating $ac_file" >&5
 echo "$as_me: creating $ac_file" >&6;}
 
   # First look for the input files in the build tree, otherwise in the
@@ -20528,7 +20529,7 @@ echo "$as_me: creating $ac_file" >&6;}
       -) echo $tmp/stdin ;;
       [\\/$]*)
          # Absolute (can't be DOS-style, as IFS=:)
-         test -f "$f" || { { echo "$as_me:20531: error: cannot find input file: $f" >&5
+         test -f "$f" || { { echo "$as_me:20532: error: cannot find input file: $f" >&5
 echo "$as_me: error: cannot find input file: $f" >&2;}
    { (exit 1); exit 1; }; }
          echo $f;;
@@ -20541,7 +20542,7 @@ echo "$as_me: error: cannot find input file: $f" >&2;}
            echo $srcdir/$f
          else
            # /dev/null tree
-           { { echo "$as_me:20544: error: cannot find input file: $f" >&5
+           { { echo "$as_me:20545: error: cannot find input file: $f" >&5
 echo "$as_me: error: cannot find input file: $f" >&2;}
    { (exit 1); exit 1; }; }
          fi;;
@@ -20599,7 +20600,7 @@ cat >>$CONFIG_STATUS <<\EOF
   rm -f $tmp/in
   if test x"$ac_file" != x-; then
     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
-      { echo "$as_me:20602: $ac_file is unchanged" >&5
+      { echo "$as_me:20603: $ac_file is unchanged" >&5
 echo "$as_me: $ac_file is unchanged" >&6;}
     else
       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
diff --git a/dist.mk b/dist.mk
index 583fe1a2dd2118a71cc443d59a3ed6aed823fe7a..618a4b703740bc206de691cdc6a49b1f40f7c3a4 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.826 2011/07/17 18:43:33 tom Exp $
+# $Id: dist.mk,v 1.827 2011/07/24 13:21:30 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 = 20110723
+NCURSES_PATCH = 20110730
 
 # We don't append the patch to the version, since this only applies to releases
 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
index 4f3a21c22b3fbdaed94ded0ab63721f85c3c91c4..94e609354f7b44d964718006b1c740bc12f13dda 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2009 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2009,2011 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -33,7 +33,7 @@
  ****************************************************************************/
 
 /*
- * $Id: tic.h,v 1.65 2009/08/08 17:52:46 tom Exp $
+ * $Id: tic.h,v 1.66 2011/07/30 21:28:43 tom Exp $
  *     tic.h - Global variables and structures for the terminfo
  *                     compiler.
  */
@@ -270,6 +270,7 @@ extern NCURSES_EXPORT(void) _nc_reset_input (FILE *, char *);
 extern NCURSES_EXPORT_VAR(int) _nc_curr_col;
 extern NCURSES_EXPORT_VAR(int) _nc_curr_line;
 extern NCURSES_EXPORT_VAR(int) _nc_syntax;
+extern NCURSES_EXPORT_VAR(int) _nc_strict_bsd;
 extern NCURSES_EXPORT_VAR(long) _nc_comment_end;
 extern NCURSES_EXPORT_VAR(long) _nc_comment_start;
 extern NCURSES_EXPORT_VAR(long) _nc_curr_file_pos;
index bfc3cc315c14765d5413a15be9282e2f14775c01..446ff98d3ebf45a79991a37e6f83670e667e29b7 100644 (file)
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998-2006,2010 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2010,2011 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -27,7 +27,7 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: infocmp.1m,v 1.46 2010/12/04 18:40:45 tom Exp $
+.\" $Id: infocmp.1m,v 1.48 2011/07/30 22:06:07 tom Exp $
 .TH @INFOCMP@ 1M ""
 .ds n 5
 .ds d @TERMINFO@
@@ -41,6 +41,7 @@ E\
 F\
 G\
 I\
+K\
 L\
 T\
 U\
@@ -107,6 +108,7 @@ l l .
 \fB\-L\fR/use the long C variable name listed in <\fBterm.h\fR>
 \fB\-C\fR/use the \fBtermcap\fR names
 \fB\-r\fR/when using \fB\-C\fR, put out all capabilities in \fBtermcap\fR form
+\fB\-K\fR/modifies the \fB\-C\fP option, improving BSD-compatibility.
 .TE
 .PP
 If no \fItermnames\fR are given, the environment variable \fBTERM\fR will be
@@ -128,6 +130,11 @@ are derivable from other \fBterminfo\fR variables, will be output.  Not all
 part of \fBtermcap\fR will normally be output.  Specifying the \fB\-r\fR option
 will take off this restriction, allowing all capabilities to be output in
 \fItermcap\fR form.
+Normally you would use both the \fB\-C\fP and \fB\-r\fP options.
+The actual format used incorporates some improvements for escaped characters
+from terminfo format.
+For a stricter BSD-compatible translation, use the \fB\-K\fR option
+rather than \fB\-C\fP.
 .PP
 Note that because padding is collected to the beginning of the capability, not
 all capabilities are output.  Mandatory padding is not supported.  Because
index e69b0d980fdd198c67d58bd338de643547327764..22509fa1ace6b963f3b0c46ecf33d40b60f7ffe4 100644 (file)
@@ -27,7 +27,7 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: ncurses.3x,v 1.104 2011/05/28 23:19:36 tom Exp $
+.\" $Id: ncurses.3x,v 1.105 2011/07/30 23:38:59 tom Exp $
 .hy 0
 .TH ncurses 3X ""
 .de bP
@@ -1007,6 +1007,13 @@ Specifies a list of directories to search for terminal descriptions.
 The list is separated by colons (i.e., ":") on Unix, semicolons on OS/2 EMX.
 All of the terminal descriptions are in terminfo form, which makes
 a subdirectory named for the first letter of the terminal names therein.
+.IP
+If \fBncurses\fP is built with a hashed database,
+then each entry in this list can also be the path of the corresponding
+database file.
+.IP
+If \fBncurses\fP is built with a support for reading termcap files
+directly, then an entry in this list may be the path of a termcap file.
 .TP 5
 TERMPATH
 If TERMCAP does not hold a file name then \fBncurses\fR checks
index 4b56e91be314499c1e1f3a87239ce0f2f07c3423..7353cd5821b25908dcba7c6da833a3aede33eccd 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: terminfo.tail,v 1.53 2010/12/04 18:38:55 tom Exp $
+.\" $Id: terminfo.tail,v 1.54 2011/07/30 23:39:52 tom Exp $
 .\" Beginning of terminfo.tail file
 .\" This file is part of ncurses.
 .\" See "terminfo.head" for copyright.
@@ -125,8 +125,8 @@ will instead look in the directory \fB$HOME/.terminfo\fR
 for a compiled description.
 If it fails to find one there, and the environment variable TERMINFO_DIRS is
 set, it will interpret the contents of that variable as a list of colon-
-separated directories to be searched (an empty entry is interpreted as a
-command to search \fI\*d\fR).
+separated directories (or database files) to be searched
+(an empty entry is interpreted as a command to search \fI\*d\fR).
 If no description is found in any of the
 TERMINFO_DIRS directories, the fetch fails.
 .PP
index cf4147fc110f35e2ca80e43db2d7c6bd492bf579..f9254138977d0251677385e0798e4da9c596c348 100644 (file)
@@ -26,7 +26,7 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: tic.1m,v 1.47 2010/12/04 18:38:55 tom Exp $
+.\" $Id: tic.1m,v 1.48 2011/07/30 21:58:54 tom Exp $
 .TH @TIC@ 1M ""
 .ds n 5
 .ds d @TERMINFO@
@@ -39,6 +39,7 @@
 C\
 G\
 I\
+K\
 L\
 N\
 T\
@@ -101,6 +102,9 @@ names, but also translates terminfo strings to termcap format.
 Capabilities
 that are not translatable are left in the entry under their terminfo names
 but commented out with two preceding dots.
+The actual format used incorporates some improvements for escaped characters
+from terminfo format.
+For a stricter BSD-compatible translation, use the \fB\-K\fR option.
 .TP
 \fB\-c\fR
 tells \fBtic\fP to only check \fIfile\fR for errors, including syntax problems and
index a9d2e128b1e558b54669027532aaea2ce73303b0..6d1a6be44a12dcc20d0466f804549603a06e488b 100644 (file)
@@ -34,7 +34,7 @@
  ****************************************************************************/
 
 /*
- * $Id: curses.priv.h,v 1.480 2011/06/25 20:36:52 tom Exp $
+ * $Id: curses.priv.h,v 1.481 2011/07/28 22:47:09 tom Exp $
  *
  *     curses.priv.h
  *
@@ -794,7 +794,7 @@ typedef struct {
        bool            init_signals;
        bool            init_screen;
 
-       const char      *comp_sourcename;
+       char            *comp_sourcename;
        char            *comp_termtype;
 
        bool            have_tic_directory;
index faedb58c8690a8b91920c0302bb2016e68b0d172..f2575f8ac2ddff9e2314296721c4d24d7037ef33 100644 (file)
@@ -93,7 +93,7 @@
 #include <ctype.h>
 #include <tic.h>
 
-MODULE_ID("$Id: captoinfo.c,v 1.64 2011/07/23 20:36:28 tom Exp $")
+MODULE_ID("$Id: captoinfo.c,v 1.69 2011/07/30 21:33:42 tom Exp $")
 
 #define MAX_PUSHED     16      /* max # args we can push onto the stack */
 
@@ -240,6 +240,12 @@ getparm(int parm, int n)
        else if (parm == 2)
            parm = 1;
     }
+
+    while (n--) {
+       dp = save_string(dp, "%p");
+       dp = save_char(dp, '0' + parm);
+    }
+
     if (onstack == parm) {
        if (n > 1) {
            _nc_warning("string may not be optimal");
@@ -255,11 +261,6 @@ getparm(int parm, int n)
 
     onstack = parm;
 
-    while (n--) {
-       dp = save_string(dp, "%p");
-       dp = save_char(dp, '0' + parm);
-    }
-
     if (seenn && parm < 3) {
        dp = save_string(dp, "%{96}%^");
     }
@@ -576,7 +577,6 @@ save_tc_inequality(char *bufptr, int c1, int c2)
 NCURSES_EXPORT(char *)
 _nc_infotocap(const char *cap GCC_UNUSED, const char *str, int const parameterized)
 {
-    int strict_bsd = 1;                /* FIXME - consider making this an option */
     int seenone = 0, seentwo = 0, saw_m = 0, saw_n = 0;
     const char *padding;
     const char *trimmed = 0;
@@ -589,8 +589,9 @@ _nc_infotocap(const char *cap GCC_UNUSED, const char *str, int const parameteriz
 
     /* we may have to move some trailing mandatory padding up front */
     padding = str + strlen(str) - 1;
-    if (padding > str && *padding == '>' && *--padding == '/') {
-       --padding;
+    if (padding > str && *padding == '>') {
+       if (*--padding == '/')
+           --padding;
        while (isdigit(UChar(*padding)) || *padding == '.' || *padding == '*')
            padding--;
        if (padding > str && *padding == '<' && *--padding == '$')
@@ -601,7 +602,7 @@ _nc_infotocap(const char *cap GCC_UNUSED, const char *str, int const parameteriz
            bufptr = save_char(bufptr, *padding++);
     }
 
-    for (; *str && str != trimmed; str++) {
+    for (; *str && ((trimmed == 0) || (str < trimmed)); str++) {
        int c1, c2;
        char *cp = 0;
 
@@ -627,7 +628,7 @@ _nc_infotocap(const char *cap GCC_UNUSED, const char *str, int const parameteriz
 
                bufptr = save_char(bufptr, *str++);
                xx1 = *str;
-               if (strict_bsd) {
+               if (_nc_strict_bsd) {
                    if (isdigit(UChar(xx1))) {
                        int pad = 0;
 
@@ -652,13 +653,11 @@ _nc_infotocap(const char *cap GCC_UNUSED, const char *str, int const parameteriz
                            bufptr = save_char(bufptr, xx2);
                            xx2 = '0';
                        }
-                   } else if (strchr("E\\:nrtbf", xx1) == 0) {
-                       /*
-                        * Note: termcap documentation claims that ":" must be
-                        * escaped as "\072", however the documentation is
-                        * incorrect - read the code.
-                        */
+                   } else if (strchr("E\\nrtbf", xx1) == 0) {
                        switch (xx1) {
+                       case 'e':
+                           xx1 = 'E';
+                           break;
                        case 'l':
                            xx1 = 'n';
                            break;
@@ -667,13 +666,25 @@ _nc_infotocap(const char *cap GCC_UNUSED, const char *str, int const parameteriz
                            bufptr = save_char(bufptr, '4');
                            xx1 = '0';
                            break;
+                       case ':':
+                           /*
+                            * Note: termcap documentation claims that ":"
+                            * must be escaped as "\072", however the
+                            * documentation is incorrect - read the code.
+                            * The replacement does not work reliably,
+                            * so the advice is not helpful.
+                            */
+                           bufptr = save_char(bufptr, '0');
+                           bufptr = save_char(bufptr, '7');
+                           xx1 = '2';
+                           break;
                        default:
                            /* should not happen, but handle this anyway */
                            sprintf(octal, "%03o", UChar(xx1));
                            bufptr = save_char(bufptr, octal[0]);
                            bufptr = save_char(bufptr, octal[1]);
                            xx1 = octal[2];
-                           continue;
+                           break;
                        }
                    }
                }
@@ -711,13 +722,13 @@ _nc_infotocap(const char *cap GCC_UNUSED, const char *str, int const parameteriz
            bufptr = save_tc_inequality(bufptr, c1, c2);
        } else if (sscanf(str, "%%?%%{%d}%%>%%t%%'%c'%%+%%;", &c1, &ch2) == 2) {
            str = strchr(str, ';');
-           bufptr = save_tc_inequality(bufptr, c1, c2);
+           bufptr = save_tc_inequality(bufptr, c1, ch2);
        } else if (sscanf(str, "%%?%%'%c'%%>%%t%%{%d}%%+%%;", &ch1, &c2) == 2) {
            str = strchr(str, ';');
-           bufptr = save_tc_inequality(bufptr, c1, c2);
+           bufptr = save_tc_inequality(bufptr, ch1, c2);
        } else if (sscanf(str, "%%?%%'%c'%%>%%t%%'%c'%%+%%;", &ch1, &ch2) == 2) {
            str = strchr(str, ';');
-           bufptr = save_tc_inequality(bufptr, c1, c2);
+           bufptr = save_tc_inequality(bufptr, ch1, ch2);
        } else if ((len = bcd_expression(str)) != 0) {
            str += len;
            bufptr = save_string(bufptr, "%B");
@@ -768,14 +779,14 @@ _nc_infotocap(const char *cap GCC_UNUSED, const char *str, int const parameteriz
                while (isdigit(UChar(*str))) {
                    ch2 = ch1;
                    ch1 = *str++;
-                   if (strict_bsd) {
+                   if (_nc_strict_bsd) {
                        if (ch1 > '3')
                            return 0;
                    } else {
                        bufptr = save_char(bufptr, ch1);
                    }
                }
-               if (strict_bsd) {
+               if (_nc_strict_bsd) {
                    if (ch2 != 0 && ch2 != '0')
                        return 0;
                    if (ch1 < '2')
@@ -802,7 +813,7 @@ _nc_infotocap(const char *cap GCC_UNUSED, const char *str, int const parameteriz
                 * termcap notation.
                 */
            case 's':
-               if (strict_bsd)
+               if (_nc_strict_bsd)
                    return 0;
                bufptr = save_string(bufptr, "%s");
                break;
index 56c362a4f7ddb05dde234aad27213d0280a235c4..24b85675795f352008059fade9157b96ffd7d01d 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2005,2007 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2007,2010 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -41,7 +41,7 @@
 
 #include <tic.h>
 
-MODULE_ID("$Id: comp_error.c,v 1.31 2007/04/21 23:38:32 tom Exp $")
+MODULE_ID("$Id: comp_error.c,v 1.32 2011/07/29 00:40:41 tom Exp $")
 
 NCURSES_EXPORT_VAR(bool) _nc_suppress_warnings = FALSE;
 NCURSES_EXPORT_VAR(int) _nc_curr_line = 0; /* current line # in input */
@@ -59,7 +59,8 @@ _nc_get_source(void)
 NCURSES_EXPORT(void)
 _nc_set_source(const char *const name)
 {
-    SourceName = name;
+    FreeIfNeeded(SourceName);
+    SourceName = strdup(name);
 }
 
 NCURSES_EXPORT(void)
index 8204d75a819368ac77d29bd645165c13f03ec1a6..649731346395cb7a0b6346f141bc195c33c51e25 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
 /*
  *     comp_parse.c -- parser driver loop and use handling.
  *
- *     _nc_read_entry_source(FILE *, literal, bool, bool (*hook)())
- *     _nc_resolve_uses2(void)
- *     _nc_free_entries(void)
- *
  *     Use this code by calling _nc_read_entry_source() on as many source
  *     files as you like (either terminfo or termcap syntax).  If you
  *     want use-resolution, call _nc_resolve_uses2().  To free the list
  *     storage, do _nc_free_entries().
- *
  */
 
 #include <curses.priv.h>
@@ -52,7 +47,7 @@
 
 #include <tic.h>
 
-MODULE_ID("$Id: comp_parse.c,v 1.73 2010/12/25 23:06:37 tom Exp $")
+MODULE_ID("$Id: comp_parse.c,v 1.74 2011/07/25 22:46:47 tom Exp $")
 
 static void sanity_check2(TERMTYPE *, bool);
 NCURSES_IMPEXP void NCURSES_API(*_nc_check_termtype2) (TERMTYPE *, bool) = sanity_check2;
@@ -61,6 +56,8 @@ NCURSES_IMPEXP void NCURSES_API(*_nc_check_termtype2) (TERMTYPE *, bool) = sanit
 static void sanity_check(TERMTYPE *);
 NCURSES_IMPEXP void NCURSES_API(*_nc_check_termtype) (TERMTYPE *) = sanity_check;
 
+static void fixup_acsc(TERMTYPE *, bool);
+
 static void
 enqueue(ENTRY * ep)
 /* add an entry to the in-core list */
@@ -378,7 +375,7 @@ _nc_resolve_uses2(bool fullresolve, bool literal)
            for_entry_list(qp) {
                _nc_curr_line = (int) qp->startline;
                _nc_set_type(_nc_first_name(qp->tterm.term_names));
-               _nc_check_termtype2(&qp->tterm, literal);
+               fixup_acsc(&qp->tterm, literal);
            }
            DEBUG(2, ("SANITY CHECK FINISHED"));
        }
@@ -402,6 +399,17 @@ _nc_resolve_uses(bool fullresolve)
 #undef CUR
 #define CUR tp->
 
+static void
+fixup_acsc(TERMTYPE *tp, bool literal)
+{
+    if (!literal) {
+       if (acs_chars == 0
+           && enter_alt_charset_mode != 0
+           && exit_alt_charset_mode != 0)
+           acs_chars = strdup(VT_ACSC);
+    }
+}
+
 static void
 sanity_check2(TERMTYPE *tp, bool literal)
 {
@@ -428,10 +436,7 @@ sanity_check2(TERMTYPE *tp, bool literal)
      * prefer to bypass it...
      */
     if (!literal) {
-       if (acs_chars == 0
-           && enter_alt_charset_mode != 0
-           && exit_alt_charset_mode != 0)
-           acs_chars = strdup(VT_ACSC);
+       fixup_acsc(tp, literal);
        ANDMISSING(enter_alt_charset_mode, acs_chars);
        ANDMISSING(exit_alt_charset_mode, acs_chars);
     }
index 8725b2edb7ebcd73a974d0c452f55a20077dcc56..5c67ffc872277c3a74f8a308c4c15f849b60f22e 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2008,2010 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -50,7 +50,7 @@
 #include <ctype.h>
 #include <tic.h>
 
-MODULE_ID("$Id: comp_scan.c,v 1.89 2010/12/25 23:06:37 tom Exp $")
+MODULE_ID("$Id: comp_scan.c,v 1.92 2011/07/30 21:36:33 tom Exp $")
 
 /*
  * Maximum length of string capability we'll accept before raising an error.
@@ -61,6 +61,7 @@ MODULE_ID("$Id: comp_scan.c,v 1.89 2010/12/25 23:06:37 tom Exp $")
 #define iswhite(ch)    (ch == ' '  ||  ch == '\t')
 
 NCURSES_EXPORT_VAR (int) _nc_syntax = 0;         /* termcap or terminfo? */
+NCURSES_EXPORT_VAR (int) _nc_strict_bsd = 1;  /* ncurses extended termcap? */
 NCURSES_EXPORT_VAR (long) _nc_curr_file_pos = 0; /* file offset of current line */
 NCURSES_EXPORT_VAR (long) _nc_comment_start = 0; /* start of comment range before name */
 NCURSES_EXPORT_VAR (long) _nc_comment_end = 0;   /* end of comment range before name */
@@ -299,6 +300,8 @@ eat_escaped_newline(int ch)
        *tok_ptr++ = (char) ch; \
        *tok_ptr = '\0'
 
+static char *tok_buf;
+
 /*
  *     int
  *     get_token()
@@ -336,7 +339,6 @@ NCURSES_EXPORT(int)
 _nc_get_token(bool silent)
 {
     static const char terminfo_punct[] = "@%&*!#";
-    static char *tok_buf;
 
     char *after_list;
     char *after_name;
@@ -376,7 +378,6 @@ _nc_get_token(bool silent)
        if (tok_buf != 0) {
            if (_nc_curr_token.tk_name == tok_buf)
                _nc_curr_token.tk_name = 0;
-           FreeAndNull(tok_buf);
        }
        return (EOF);
     }
@@ -390,6 +391,7 @@ _nc_get_token(bool silent)
     }
 
     ch = eat_escaped_newline(ch);
+    _nc_curr_token.tk_valstring = 0;
 
 #ifdef TRACE
     old_line = _nc_curr_line;
@@ -758,21 +760,27 @@ _nc_trans_string(char *ptr, char *last)
                *(ptr++) = (char) (c);
            }
        } else if (c == '\\') {
+           bool strict_bsd = ((_nc_syntax == SYN_TERMCAP) && _nc_strict_bsd);
+
            c = next_char();
            if (c == EOF)
                _nc_err_abort(MSG_NO_INPUTS);
 
-           if (c >= '0' && c <= '7') {
+#define isoctal(c) ((c) >= '0' && (c) <= '7')
+
+           if (isoctal(c) || (strict_bsd && isdigit(c))) {
                number = c - '0';
                for (i = 0; i < 2; i++) {
                    c = next_char();
                    if (c == EOF)
                        _nc_err_abort(MSG_NO_INPUTS);
 
-                   if (c < '0' || c > '7') {
+                   if (!isoctal(c)) {
                        if (isdigit(c)) {
-                           _nc_warning("Non-octal digit `%c' in \\ sequence", c);
-                           /* allow the digit; it'll do less harm */
+                           if (!strict_bsd) {
+                               _nc_warning("Non-octal digit `%c' in \\ sequence", c);
+                               /* allow the digit; it'll do less harm */
+                           }
                        } else {
                            push_back((char) c);
                            break;
@@ -782,21 +790,16 @@ _nc_trans_string(char *ptr, char *last)
                    number = number * 8 + c - '0';
                }
 
-               if (number == 0)
+               number = UChar(number);
+               if (number == 0 && !strict_bsd)
                    number = 0200;
                *(ptr++) = (char) number;
            } else {
                switch (c) {
                case 'E':
-               case 'e':
                    *(ptr++) = '\033';
                    break;
 
-               case 'a':
-                   *(ptr++) = '\007';
-                   break;
-
-               case 'l':
                case 'n':
                    *(ptr++) = '\n';
                    break;
@@ -809,10 +812,6 @@ _nc_trans_string(char *ptr, char *last)
                    *(ptr++) = '\010';
                    break;
 
-               case 's':
-                   *(ptr++) = ' ';
-                   break;
-
                case 'f':
                    *(ptr++) = '\014';
                    break;
@@ -833,16 +832,33 @@ _nc_trans_string(char *ptr, char *last)
                    *(ptr++) = ',';
                    break;
 
-               case ':':
-                   *(ptr++) = ':';
-                   break;
-
                case '\n':
                    continue;
 
                default:
-                   _nc_warning("Illegal character '%s' in \\ sequence",
-                               unctrl(UChar(c)));
+                   if ((_nc_syntax == SYN_TERMINFO) || !_nc_strict_bsd) {
+                       switch (c) {
+                       case 'a':
+                           c = '\007';
+                           break;
+                       case 'e':
+                           c = '\033';
+                           break;
+                       case 'l':
+                           c = '\n';
+                           break;
+                       case 's':
+                           c = ' ';
+                           break;
+                       case ':':
+                           c = ':';
+                           break;
+                       default:
+                           _nc_warning("Illegal character '%s' in \\ sequence",
+                                       unctrl(UChar(c)));
+                           break;
+                       }
+                   }
                    /* FALLTHRU */
                case '|':
                    *(ptr++) = (char) c;
@@ -934,5 +950,8 @@ _nc_comp_scan_leaks(void)
     if (pushname != 0) {
        FreeAndNull(pushname);
     }
+    if (tok_buf != 0) {
+       FreeAndNull(tok_buf);
+    }
 }
 #endif
index ddbc25204fec882b0bde07bc38c6181d6d3b540a..0e3a8bfad198a7f97dc3a17f63fa796d12ab4c9e 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -47,7 +47,7 @@
 #include <ctype.h>
 #include <tic.h>
 
-MODULE_ID("$Id: parse_entry.c,v 1.75 2010/05/01 19:35:09 tom Exp $")
+MODULE_ID("$Id: parse_entry.c,v 1.76 2011/07/27 01:14:47 tom Exp $")
 
 #ifdef LINT
 static short const parametrized[] =
@@ -203,6 +203,8 @@ _nc_extend_names(ENTRY * entryp, char *name, int token_type)
        { bad_tc_usage = TRUE; \
         _nc_warning("Legacy termcap allows only a trailing tc= clause"); }
 
+#define MAX_NUMBER 0x7fff      /* positive shorts only */
+
 NCURSES_EXPORT(int)
 _nc_parse_entry(struct entry *entryp, int literal, bool silent)
 {
@@ -444,8 +446,12 @@ _nc_parse_entry(struct entry *entryp, int literal, bool silent)
                break;
 
            case NUMBER:
-               entryp->tterm.Numbers[entry_ptr->nte_index] =
-                   (short) _nc_curr_token.tk_valnumber;
+               if (_nc_curr_token.tk_valnumber > MAX_NUMBER) {
+                   entryp->tterm.Numbers[entry_ptr->nte_index] = MAX_NUMBER;
+               } else {
+                   entryp->tterm.Numbers[entry_ptr->nte_index] =
+                       (short) _nc_curr_token.tk_valnumber;
+               }
                break;
 
            case STRING:
index e38b9cbe49d8c408c0ccc170742c90511b4bbf1a..8eee695eee3890091da5ae25a786051119071f49 100644 (file)
@@ -41,7 +41,7 @@
 
 #include <tic.h>
 
-MODULE_ID("$Id: read_entry.c,v 1.108 2011/02/26 15:36:06 tom Exp $")
+MODULE_ID("$Id: read_entry.c,v 1.109 2011/07/25 22:21:34 tom Exp $")
 
 #define TYPE_CALLOC(type,elts) typeCalloc(type, (unsigned)(elts))
 
@@ -401,7 +401,7 @@ _nc_read_tic_entry(char *filename,
                   const char *name,
                   TERMTYPE *const tp)
 {
-    int result = TGETENT_NO;
+    int code = TGETENT_NO;
 
     /*
      * If we are looking in a directory, assume the entry is a file under that,
@@ -412,9 +412,9 @@ _nc_read_tic_entry(char *filename,
        (void) sprintf(filename, "%s/" LEAF_FMT "/%s", path, *name, name);
 
     if (_nc_is_dir_path(path))
-       result = _nc_read_file_entry(filename, tp);
-#if USE_HASHED_DB
+       code = _nc_read_file_entry(filename, tp);
     else {
+#if USE_HASHED_DB
        static const char suffix[] = DBM_SUFFIX;
        DB *capdbp;
        unsigned lens = sizeof(suffix) - 1;
@@ -467,8 +467,8 @@ _nc_read_tic_entry(char *filename,
                    if (*have++ == 0) {
                        if (data.size > key.size
                            && IS_TIC_MAGIC(have)) {
-                           result = _nc_read_termtype(tp, have, used);
-                           if (result == TGETENT_NO) {
+                           code = _nc_read_termtype(tp, have, used);
+                           if (code == TGETENT_NO) {
                                _nc_free_termtype(tp);
                            }
                        }
@@ -493,9 +493,15 @@ _nc_read_tic_entry(char *filename,
                free(save);
            }
        }
-    }
 #endif
-    return result;
+#if USE_TERMCAP
+       if (code != TGETENT_YES) {
+           code = _nc_read_termcap_entry(name, tp);
+           sprintf(filename, "%.*s", PATH_MAX - 1, _nc_get_source());
+       }
+#endif
+    }
+    return code;
 }
 #endif /* USE_DATABASE */
 
@@ -533,8 +539,7 @@ _nc_read_entry(const char *const name, char *const filename, TERMTYPE *const tp)
                break;
            }
        }
-#endif
-#if USE_TERMCAP
+#elif USE_TERMCAP
        if (code != TGETENT_YES) {
            code = _nc_read_termcap_entry(name, tp);
            sprintf(filename, "%.*s", PATH_MAX - 1, _nc_get_source());
index eac37fa3d5d164e6d4af0a21b7f3a8f491bc0ea5..700dd77db46e78dd9a6d1ccda134f10063314e48 100644 (file)
@@ -56,7 +56,7 @@
 #include <sys/types.h>
 #include <tic.h>
 
-MODULE_ID("$Id: read_termcap.c,v 1.76 2011/06/05 00:48:00 tom Exp $")
+MODULE_ID("$Id: read_termcap.c,v 1.79 2011/07/29 00:25:02 tom Exp $")
 
 #if !PURE_TERMINFO
 
@@ -441,8 +441,10 @@ _nc_getent(
                break;
        }
 
-       if (!foundit)
+       if (!foundit) {
+           free(record);
            return (TC_NOT_FOUND);
+       }
     }
 
     /*
@@ -454,7 +456,7 @@ _nc_getent(
        register int newilen;
        unsigned ilen;
        int diff, iret, tclen, oline;
-       char *icap, *scan, *tc, *tcstart, *tcend;
+       char *icap = 0, *scan, *tc, *tcstart, *tcend;
 
        /*
         * Loop invariants:
@@ -467,8 +469,9 @@ _nc_getent(
        scan = record;
        tc_not_resolved = FALSE;
        for (;;) {
-           if ((tc = _nc_cgetcap(scan, "tc", '=')) == 0)
+           if ((tc = _nc_cgetcap(scan, "tc", '=')) == 0) {
                break;
+           }
 
            /*
             * Find end of tc=name and stomp on the trailing `:'
@@ -485,6 +488,7 @@ _nc_getent(
            tclen = s - tcstart;
            tcend = s;
 
+           icap = 0;
            iret = _nc_getent(&icap, &ilen, &oline, current, db_array, fd,
                              tc, depth + 1, 0);
            newicap = icap;     /* Put into a register. */
@@ -495,12 +499,13 @@ _nc_getent(
                    if (myfd)
                        (void) close(fd);
                    free(record);
+                   FreeIfNeeded(icap);
                    return (iret);
                }
-               if (iret == TC_UNRESOLVED)
+               if (iret == TC_UNRESOLVED) {
                    tc_not_resolved = TRUE;
-               /* couldn't resolve tc */
-               if (iret == TC_NOT_FOUND) {
+                   /* couldn't resolve tc */
+               } else if (iret == TC_NOT_FOUND) {
                    *(s - 1) = ':';
                    scan = s - 1;
                    tc_not_resolved = TRUE;
@@ -580,8 +585,9 @@ _nc_getent(
     }
 
     *cap = record;
-    if (tc_not_resolved)
+    if (tc_not_resolved) {
        return (TC_UNRESOLVED);
+    }
     return (current);
 }
 
@@ -840,6 +846,9 @@ _nc_tgetent(char *bp, char **sourcename, int *lineno, const char *name)
        }
     }
     *fname = 0;                        /* mark end of vector */
+#if !HAVE_BSD_CGETENT
+    (void) _nc_cgetset(0);
+#endif
     if (_nc_is_abs_path(cp)) {
        if (_nc_cgetset(cp) < 0) {
            return (TC_SYS_ERR);
@@ -979,7 +988,7 @@ _nc_read_termcap_entry(const char *const tn, TERMTYPE *const tp)
        _nc_curr_line = lineno;
        _nc_set_source(source);
     }
-    _nc_read_entry_source((FILE *) 0, tc, FALSE, FALSE, NULLHOOK);
+    _nc_read_entry_source((FILE *) 0, tc, FALSE, TRUE, NULLHOOK);
 #else
     /*
      * Here is what the 4.4BSD termcap(3) page prescribes:
index bdb8a0f0489874ee5adf8b628dda30a4cb6d4c96..648bd78c011464ad38863ad0c8d44f90855bee53 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: Makefile.in,v 1.85 2010/11/27 21:45:27 tom Exp $
+# $Id: Makefile.in,v 1.86 2011/07/30 22:51:50 tom Exp $
 ##############################################################################
 # Copyright (c) 1998-2009,2010 Free Software Foundation, Inc.                #
 #                                                                            #
@@ -104,6 +104,7 @@ LOCAL_LIBDIR        = @top_builddir@/lib
 LD             = @LD@
 LINK           = @LINK_PROGS@ $(LIBTOOL_LINK)
 LDFLAGS                = @EXTRA_LDFLAGS@ @LDFLAGS@
+RPATH_LIST     = @RPATH_LIST@
 
 LDFLAGS_LIBTOOL        = $(LDFLAGS) $(CFLAGS_LIBTOOL)
 LDFLAGS_NORMAL = $(LDFLAGS) $(CFLAGS_NORMAL)
index e034a58596fc9fd4a90f02be7a80a08992590557..131771724a91bff07a260338a03b791ce955ace9 100644 (file)
@@ -42,7 +42,7 @@
 
 #include <dump_entry.h>
 
-MODULE_ID("$Id: infocmp.c,v 1.106 2011/05/14 22:51:04 tom Exp $")
+MODULE_ID("$Id: infocmp.c,v 1.107 2011/07/30 21:51:01 tom Exp $")
 
 #define L_CURL "{"
 #define R_CURL "}"
@@ -975,6 +975,7 @@ usage(void)
        ,""
        ,"Options:"
        ,"  -1    print single-column"
+       ,"  -K    use termcap-names and BSD syntax"
        ,"  -C    use termcap-names"
        ,"  -F    compare terminfo-files"
        ,"  -I    use terminfo-names"
@@ -1288,6 +1289,7 @@ main(int argc, char *argv[])
 #if NCURSES_XNAMES
     use_extended_names(FALSE);
 #endif
+    _nc_strict_bsd = 0;
 
     _nc_progname = _nc_rootname(argv[0]);
 
@@ -1298,7 +1300,7 @@ main(int argc, char *argv[])
 
     while ((c = getopt(argc,
                       argv,
-                      "1A:aB:CcdEeFfGgIiLlnpqR:rs:TtUuVv:w:x")) != -1) {
+                      "1A:aB:CcdEeFfGgIiKLlnpqR:rs:TtUuVv:w:x")) != -1) {
        switch (c) {
        case '1':
            mwidth = 0;
@@ -1318,6 +1320,9 @@ main(int argc, char *argv[])
            restdir = optarg;
            break;
 
+       case 'K':
+           _nc_strict_bsd = 1;
+           /* FALLTHRU */
        case 'C':
            outform = F_TERMCAP;
            tversion = "BSD";
index 739e7ed71ac4aa7fab979c6fdca22d176391e4a8..be0a36356c2209694d82ce078f261b592e4092b0 100644 (file)
@@ -44,7 +44,7 @@
 #include <dump_entry.h>
 #include <transform.h>
 
-MODULE_ID("$Id: tic.c,v 1.150 2011/05/21 18:15:45 tom Exp $")
+MODULE_ID("$Id: tic.c,v 1.151 2011/07/30 21:49:32 tom Exp $")
 
 const char *_nc_progname = "tic";
 
@@ -74,6 +74,7 @@ f\
 G\
 g\
 I\
+K\
 L\
 N\
 r\
@@ -133,6 +134,7 @@ usage(void)
 #if NCURSES_XNAMES
        "  -a         retain commented-out capabilities (sets -x also)",
 #endif
+       "  -K         translate entries to termcap source form with BSD syntax",
        "  -C         translate entries to termcap source form",
        "  -c         check only, validate input without compiling or translating",
        "  -e<names>  translate/compile only entries named by comma-separated list",
@@ -514,6 +516,7 @@ main(int argc, char *argv[])
 #if NCURSES_XNAMES
     use_extended_names(FALSE);
 #endif
+    _nc_strict_bsd = 0;
 
     /*
      * Processing arguments is a little complicated, since someone made a
@@ -521,7 +524,7 @@ main(int argc, char *argv[])
      * be optional.
      */
     while ((this_opt = getopt(argc, argv,
-                             "0123456789CILNR:TUVace:fGgo:rstvwx")) != -1) {
+                             "0123456789CIKLNR:TUVace:fGgo:rstvwx")) != -1) {
        if (isdigit(this_opt)) {
            switch (last_opt) {
            case 'v':
@@ -539,6 +542,9 @@ main(int argc, char *argv[])
            continue;
        }
        switch (this_opt) {
+       case 'K':
+           _nc_strict_bsd = 1;
+           /* FALLTHRU */
        case 'C':
            capdump = TRUE;
            outform = F_TERMCAP;