]> ncurses.scripts.mit.edu Git - ncurses.git/commitdiff
ncurses 5.9 - patch 20130615
authorThomas E. Dickey <dickey@invisible-island.net>
Sat, 15 Jun 2013 22:39:16 +0000 (22:39 +0000)
committerThomas E. Dickey <dickey@invisible-island.net>
Sat, 15 Jun 2013 22:39:16 +0000 (22:39 +0000)
+ minor changes to some configure macros to make them more reusable.
+ fixes for tabs program (prompted by report by Nick Andrik):
  + corrected logic in command-line parsing of -a and -c predefined
    tab-lists options.
  + allow "-0" and "-8" options to be combined with others, e.g.,"-0d".
  + make warning messages more consistent with the other utilities by
    not printing the full pathname of the program.
  + add -V option for consistency with other utilities.
+ fix off-by-one in columns for tabs program when processing an option
  such as "-5" (patch by Nick Andrik).

Ada95/aclocal.m4
MANIFEST
NEWS
aclocal.m4
dist.mk
man/tabs.1
package/debian/changelog
package/ncurses.spec
progs/tabs.c

index 3f7ad84e5344f0e00fbccf8324a7d9f5e10cafe8..a289df675a5750ccd8bac58b671e51c01e1bc08e 100644 (file)
@@ -28,7 +28,7 @@ dnl***************************************************************************
 dnl
 dnl Author: Thomas E. Dickey
 dnl
-dnl $Id: aclocal.m4,v 1.66 2013/04/13 23:00:18 tom Exp $
+dnl $Id: aclocal.m4,v 1.67 2013/06/15 21:13:50 tom Exp $
 dnl Macros used in NCURSES Ada95 auto-configuration script.
 dnl
 dnl These macros are maintained separately from NCURSES.  The copyright on
@@ -1752,7 +1752,7 @@ ifelse($1,,,[$1=$LIB_PREFIX])
        AC_SUBST(LIB_PREFIX)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_LIB_SUFFIX version: 18 updated: 2012/02/25 15:20:07
+dnl CF_LIB_SUFFIX version: 19 updated: 2013/06/15 11:58:48
 dnl -------------
 dnl Compute the library file-suffix from the given model name
 dnl $1 = model name
@@ -1761,7 +1761,6 @@ dnl $3 = dependency variable to set (actual filename)
 dnl The variable $LIB_SUFFIX, if set, prepends the variable to set.
 AC_DEFUN([CF_LIB_SUFFIX],
 [
-       AC_REQUIRE([CF_SUBST_NCURSES_VERSION])
        case $1 in #(vi
        libtool) #(vi
                $2='.la'
@@ -2835,7 +2834,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: 72 updated: 2013/01/26 16:26:12
+dnl CF_SHARED_OPTS version: 73 updated: 2013/06/15 12:17:19
 dnl --------------
 dnl --------------
 dnl Attempt to determine the appropriate CC/LD options for creating a shared
@@ -2861,7 +2860,6 @@ dnl
 dnl Some loaders leave 'so_locations' lying around.  It's nice to clean up.
 AC_DEFUN([CF_SHARED_OPTS],
 [
-       AC_REQUIRE([CF_SUBST_NCURSES_VERSION])
        AC_REQUIRE([CF_LD_RPATH_OPT])
        LOCAL_LDFLAGS=
        LOCAL_LDFLAGS2=
index b7eb016057762bb86d1a057c9f049b5156df7e72..b42877d3b5aee20fee4379952cd618fae1b836c4 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
 ./test/ditto.c
 ./test/dots.c
 ./test/dots_mvcur.c
+./test/dots_termcap.c
 ./test/echochar.c
 ./test/edit_field.c
 ./test/edit_field.h
diff --git a/NEWS b/NEWS
index f38adef03296d07c7bcc9bd605a70cf541027f79..93d1e873aea52f7b04c19372eebb3f37db719476 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.2069 2013/06/08 21:00:03 tom Exp $
+-- $Id: NEWS,v 1.2072 2013/06/15 21:16:04 tom Exp $
 -------------------------------------------------------------------------------
 
 This is a log of changes that ncurses has gone through since Zeyd started
@@ -45,6 +45,18 @@ 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.
 
+20130615
+       + minor changes to some configure macros to make them more reusable.
+       + fixes for tabs program (prompted by report by Nick Andrik):
+         + corrected logic in command-line parsing of -a and -c predefined
+           tab-lists options.
+         + allow "-0" and "-8" options to be combined with others, e.g.,"-0d".
+         + make warning messages more consistent with the other utilities by
+           not printing the full pathname of the program.
+         + add -V option for consistency with other utilities.
+       + fix off-by-one in columns for tabs program when processing an option
+         such as "-5" (patch by Nick Andrik).
+
 20130608
        + add to test/demo_forms.c examples of using the menu-hooks as well
          as showing how the menu item user-data can be used to pass a callback
index 9a8c65ec1c21bbbf2d4ece74009136a984a3cee2..c173bebe473f10a7705f4dbc68a8ef87b889708d 100644 (file)
@@ -28,7 +28,7 @@ dnl***************************************************************************
 dnl
 dnl Author: Thomas E. Dickey 1995-on
 dnl
-dnl $Id: aclocal.m4,v 1.666 2013/04/13 22:59:35 tom Exp $
+dnl $Id: aclocal.m4,v 1.668 2013/06/15 16:22:56 tom Exp $
 dnl Macros used in NCURSES auto-configuration script.
 dnl
 dnl These macros are maintained separately from NCURSES.  The copyright on
@@ -3673,7 +3673,7 @@ fi
 ])
 ])
 dnl ---------------------------------------------------------------------------
-dnl CF_LIB_SUFFIX version: 18 updated: 2012/02/25 15:20:07
+dnl CF_LIB_SUFFIX version: 19 updated: 2013/06/15 11:58:48
 dnl -------------
 dnl Compute the library file-suffix from the given model name
 dnl $1 = model name
@@ -3682,7 +3682,6 @@ dnl $3 = dependency variable to set (actual filename)
 dnl The variable $LIB_SUFFIX, if set, prepends the variable to set.
 AC_DEFUN([CF_LIB_SUFFIX],
 [
-       AC_REQUIRE([CF_SUBST_NCURSES_VERSION])
        case $1 in #(vi
        libtool) #(vi
                $2='.la'
@@ -5335,7 +5334,7 @@ CF_VERBOSE(...checked $1 [$]$1)
 AC_SUBST(EXTRA_LDFLAGS)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_SHARED_OPTS version: 72 updated: 2013/01/26 16:26:12
+dnl CF_SHARED_OPTS version: 73 updated: 2013/06/15 12:17:19
 dnl --------------
 dnl --------------
 dnl Attempt to determine the appropriate CC/LD options for creating a shared
@@ -5361,7 +5360,6 @@ dnl
 dnl Some loaders leave 'so_locations' lying around.  It's nice to clean up.
 AC_DEFUN([CF_SHARED_OPTS],
 [
-       AC_REQUIRE([CF_SUBST_NCURSES_VERSION])
        AC_REQUIRE([CF_LD_RPATH_OPT])
        LOCAL_LDFLAGS=
        LOCAL_LDFLAGS2=
diff --git a/dist.mk b/dist.mk
index d439d575edf5ec1c248e60af81788973728ff12e..f38a92c65aa0a4966bbbd74e9b9e4ddf8e95592c 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.932 2013/06/07 08:08:46 tom Exp $
+# $Id: dist.mk,v 1.933 2013/06/15 21:17:44 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 = 20130608
+NCURSES_PATCH = 20130615
 
 # We don't append the patch to the version, since this only applies to releases
 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
index 32d30520b94877f3384e9601cc14f67534910639..7732349272c1c1c659a980a0a36cd9b99c55a846 100644 (file)
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 2008-2010,2011 Free Software Foundation, Inc.              *
+.\" Copyright (c) 2008-2011,2013 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            *
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: tabs.1,v 1.9 2011/12/17 23:31:59 tom Exp $
+.\" $Id: tabs.1,v 1.10 2013/06/11 00:56:40 tom Exp $
 .TH @TABS@ 1 ""
 .ds n 5
 .SH NAME
 \fB@TABS@\fR \- set tabs on a terminal
 .SH SYNOPSIS
-\fB@TABS@\fR [\fB\-v\fR[\fIn\fR]] [\fB\-ahuUV\fR] \fIfile...\fR
+\fB@TABS@\fR [\fIoptions\fR]] \fI[tabstop-list]\fR
 .br
 .SH DESCRIPTION
 .PP
@@ -61,6 +61,9 @@ The second data line shows the actual tab-stops, marked with asterisks.
 .B \-n
 This option tells \fB@TABS@\fP to check the options and run any debugging
 option, but not to modify the terminal settings.
+.TP
+\fB\-V\fR
+reports the version of ncurses which was used in this program, and exits.
 .PP
 The \fB@TABS@\fP program processes a single list of tab stops.
 The last option to be processed which defines a list is the one that
index cbd95db45293115d0e6b82ee5daf2af34d945e3a..675d7deaab98fb2a3c90ef5e57c80cd08ed43123 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (5.9-20130608) unstable; urgency=low
+ncurses6 (5.9-20130615) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 01 Jun 2013 07:49:17 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 15 Jun 2013 17:17:42 -0400
 
 ncurses6 (5.9-20120608) unstable; urgency=low
 
index 8a285ac07ea9f86626be788f2ce569e54e0195f8..bf1f4dd8f28aeb62cd3beec55623837db44f1b3a 100644 (file)
@@ -1,7 +1,7 @@
 Summary: shared libraries for terminal handling
 Name: ncurses6
 Release: 5.9
-Version: 20130608
+Version: 20130615
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{release}-%{version}.tgz
index bded0b04b259812db51be662d6305ac4a7dbc00c..7ed3007549d8ac7ea2d6bba11481b5e3c6bb0cf4 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2008-2011,2012 Free Software Foundation, Inc.              *
+ * Copyright (c) 2008-2012,2013 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            *
 #define USE_LIBTINFO
 #include <progs.priv.h>
 
-MODULE_ID("$Id: tabs.c,v 1.25 2012/11/18 01:21:47 tom Exp $")
+MODULE_ID("$Id: tabs.c,v 1.34 2013/06/11 08:18:27 tom Exp $")
 
 static void usage(void) GCC_NORETURN;
 
+static char *prg_name;
 static int max_cols;
 
 static void
@@ -101,8 +102,8 @@ decode_tabs(const char *tab_list)
            result[n] = value + prior;
            if (n > 0 && result[n] <= result[n - 1]) {
                fprintf(stderr,
-                       "tab-stops are not in increasing order: %d %d\n",
-                       value, result[n - 1]);
+                       "%s: tab-stops are not in increasing order: %d %d\n",
+                       prg_name, value, result[n - 1]);
                free(result);
                result = 0;
                break;
@@ -122,6 +123,7 @@ decode_tabs(const char *tab_list)
         */
        if ((n == 0) && (value > 0)) {
            int step = value;
+           value = 1;
            while (n < max_cols - 1) {
                result[n++] = value;
                value += step;
@@ -293,7 +295,7 @@ add_to_tab_list(char **append, const char *value)
  * Check for illegal characters in the tab-list.
  */
 static bool
-legal_tab_list(const char *program, const char *tab_list)
+legal_tab_list(const char *tab_list)
 {
     bool result = TRUE;
 
@@ -305,22 +307,34 @@ legal_tab_list(const char *program, const char *tab_list)
                if (!(isdigit(ch) || ch == ',' || ch == '+')) {
                    fprintf(stderr,
                            "%s: unexpected character found '%c'\n",
-                           program, ch);
+                           prg_name, ch);
                    result = FALSE;
                    break;
                }
            }
        } else {
-           fprintf(stderr, "%s: trailing comma found '%s'\n", program, tab_list);
+           fprintf(stderr, "%s: trailing comma found '%s'\n", prg_name, tab_list);
            result = FALSE;
        }
     } else {
-       fprintf(stderr, "%s: no tab-list given\n", program);
+       fprintf(stderr, "%s: no tab-list given\n", prg_name);
        result = FALSE;
     }
     return result;
 }
 
+static char *
+skip_list(char *value)
+{
+    while (*value != '\0' &&
+          (isdigit(UChar(*value)) ||
+           isspace(UChar(*value)) ||
+           strchr("+,", UChar(*value)) != 0)) {
+       ++value;
+    }
+    return value;
+}
+
 static void
 usage(void)
 {
@@ -343,6 +357,7 @@ usage(void)
        ,"  -s       SNOBOL"
        ,"  -u       UNIVAC 1100 Assembler"
        ,"  -T name  use terminal type 'name'"
+       ,"  -V       print version"
        ,""
        ,"A tabstop-list is an ordered list of column numbers, e.g., 1,11,21"
        ,"or 1,+10,+10 which is the same."
@@ -367,6 +382,8 @@ main(int argc, char *argv[])
     char *append = 0;
     const char *tab_list = 0;
 
+    prg_name = _nc_rootname(argv[0]);
+
     if ((term_name = getenv("TERM")) == 0)
        term_name = "ansi+tabs";
 
@@ -378,23 +395,25 @@ main(int argc, char *argv[])
            while ((ch = *++option) != '\0') {
                switch (ch) {
                case 'a':
-                   switch (*option) {
+                   switch (*++option) {
+                   default:
                    case '\0':
                        tab_list = "1,10,16,36,72";
+                       option--;
                        /* Assembler, IBM S/370, first format */
                        break;
                    case '2':
                        tab_list = "1,10,16,40,72";
                        /* Assembler, IBM S/370, second format */
                        break;
-                   default:
-                       usage();
                    }
                    break;
                case 'c':
-                   switch (*option) {
+                   switch (*++option) {
+                   default:
                    case '\0':
                        tab_list = "1,8,12,16,20,55";
+                       option--;
                        /* COBOL, normal format */
                        break;
                    case '2':
@@ -405,8 +424,6 @@ main(int argc, char *argv[])
                        tab_list = "1,6,10,14,18,22,26,30,34,38,42,46,50,54,58,62,67";
                        /* COBOL compact format extended */
                        break;
-                   default:
-                       usage();
                    }
                    break;
                case 'd':       /* ncurses extension */
@@ -437,17 +454,22 @@ main(int argc, char *argv[])
                        term_name = option;
                    } else {
                        term_name = argv[n++];
+                       option--;
                    }
                    option += ((int) strlen(option)) - 1;
                    continue;
+               case 'V':
+                   puts(curses_version());
+                   ExitProgram(EXIT_SUCCESS);
                default:
                    if (isdigit(UChar(*option))) {
-                       tab_list = option;
-                       ++n;
+                       char *copy = strdup(option);
+                       *skip_list(copy) = '\0';
+                       tab_list = copy;
+                       option = skip_list(option) - 1;
                    } else {
                        usage();
                    }
-                   option += ((int) strlen(option)) - 1;
                    break;
                }
            }
@@ -491,12 +513,12 @@ main(int argc, char *argv[])
     if (!VALID_STRING(clear_all_tabs)) {
        fprintf(stderr,
                "%s: terminal type '%s' cannot reset tabs\n",
-               argv[0], term_name);
+               prg_name, term_name);
     } else if (!VALID_STRING(set_tab)) {
        fprintf(stderr,
                "%s: terminal type '%s' cannot set tabs\n",
-               argv[0], term_name);
-    } else if (legal_tab_list(argv[0], tab_list)) {
+               prg_name, term_name);
+    } else if (legal_tab_list(tab_list)) {
        int *list = decode_tabs(tab_list);
 
        if (!no_op)