ncurses 5.9 - patch 20130126

+ further fixes to mvcur to pass callback function (cf: 20130112),
  needed to make test/dots_mvcur work.
+ reduce calls to SetConsoleActiveScreenBuffer in win_driver.c, to
  help reduce flicker.
+ modify configure script to omit "+b" from linker options for very
  old HP-UX systems (report by Dennis Grevenstein)
+ add HP-UX workaround for missing EILSEQ on old HP-UX systems (patch
  by Dennis Grevenstein).
+ restore memmove/strdup support for antique systems (request by
  Dennis Grevenstein).
+ change %l behavior in tparm to push the string length onto the stack
  rather than saving the formatted length into the output buffer
  (report by Roy Marples, cf: 980620).
This commit is contained in:
Thomas E. Dickey 2013-01-27 02:16:18 +00:00
parent 4ceb04b5e1
commit 2403eaecbe
20 changed files with 3217 additions and 2819 deletions

34
Ada95/aclocal.m4 vendored
View File

@ -1,5 +1,5 @@
dnl***************************************************************************
dnl Copyright (c) 2010-2011,2012 Free Software Foundation, Inc. *
dnl Copyright (c) 2010-2012,2013 Free Software Foundation, Inc. *
dnl *
dnl Permission is hereby granted, free of charge, to any person obtaining a *
dnl copy of this software and associated documentation files (the *
@ -28,7 +28,7 @@ dnl***************************************************************************
dnl
dnl Author: Thomas E. Dickey
dnl
dnl $Id: aclocal.m4,v 1.63 2012/12/23 00:58:27 tom Exp $
dnl $Id: aclocal.m4,v 1.64 2013/01/26 22:15:40 tom Exp $
dnl Macros used in NCURSES Ada95 auto-configuration script.
dnl
dnl These macros are maintained separately from NCURSES. The copyright on
@ -2833,7 +2833,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: 71 updated: 2012/12/22 19:34:47
dnl CF_SHARED_OPTS version: 72 updated: 2013/01/26 16:26:12
dnl --------------
dnl --------------
dnl Attempt to determine the appropriate CC/LD options for creating a shared
@ -2956,6 +2956,14 @@ CF_EOF
LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
fi
;;
hpux[[7-8]]*) #(vi
# HP-UX 8.07 ld lacks "+b" option used for libdir search-list
if test "$GCC" != yes; then
CC_SHARED_OPTS='+Z'
fi
MK_SHARED_LIB='${LD} -b -o $[@]'
INSTALL_LIB="-m 555"
;;
hpux*) #(vi
# (tested with gcc 2.7.2 -- I don't have c89)
if test "$GCC" = yes; then
@ -3638,6 +3646,26 @@ if test "$with_pthread" != no ; then
fi
])
dnl ---------------------------------------------------------------------------
dnl CF_WITH_SYSTYPE version: 1 updated: 2013/01/26 16:26:12
dnl ---------------
dnl For testing, override the derived host system-type which is used to decide
dnl things such as the linker commands used to build shared libraries. This is
dnl normally chosen automatically based on the type of system which you are
dnl building on. We use it for testing the configure script.
dnl
dnl This is different from the --host option: it is used only for testing parts
dnl of the configure script which would not be reachable with --host since that
dnl relies on the build environment being real, rather than mocked up.
AC_DEFUN([CF_WITH_SYSTYPE],[
CF_CHECK_CACHE([AC_CANONICAL_SYSTEM])
AC_ARG_WITH(system-type,
[ --with-system-type=XXX test: override derived host system-type],
[AC_MSG_WARN(overriding system type to $withval)
cf_cv_system_name=$withval
host_os=$withval
])
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_XOPEN_SOURCE version: 42 updated: 2012/01/07 08:26:49
dnl ---------------
dnl Try to get _XOPEN_SOURCE defined properly that we can use POSIX functions,

1960
Ada95/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -28,24 +28,20 @@ dnl***************************************************************************
dnl
dnl Author: Thomas E. Dickey
dnl
dnl $Id: configure.in,v 1.45 2012/10/06 22:42:31 tom Exp $
dnl $Id: configure.in,v 1.46 2013/01/26 21:26:06 tom Exp $
dnl Process this file with autoconf to produce a configure script.
dnl
dnl See http://invisible-island.net/autoconf/ for additional information.
dnl
dnl ---------------------------------------------------------------------------
AC_PREREQ(2.52.20030208)
AC_REVISION($Revision: 1.45 $)
AC_REVISION($Revision: 1.46 $)
AC_INIT(gen/gen.c)
AC_CONFIG_HEADER(include/ncurses_cfg.h:include/ncurses_cfg.hin)
CF_TOP_BUILDDIR
CF_CHECK_CACHE([AC_CANONICAL_SYSTEM])
AC_ARG_WITH(system-type,
[ --with-system-type=XXX test: override derived host system-type],
[AC_MSG_WARN(overriding system type to $withval)
cf_cv_system_name=$withval])
CF_WITH_SYSTYPE
### Save the given $CFLAGS to allow user-override.
cf_user_CFLAGS="$CFLAGS"

View File

@ -921,10 +921,10 @@
./ncurses/tinfo/make_hash.c
./ncurses/tinfo/make_keys.c
./ncurses/tinfo/name_match.c
./ncurses/tinfo/obsolete.c
./ncurses/tinfo/parse_entry.c
./ncurses/tinfo/read_entry.c
./ncurses/tinfo/read_termcap.c
./ncurses/tinfo/setbuf.c
./ncurses/tinfo/strings.c
./ncurses/tinfo/tinfo_driver.c
./ncurses/tinfo/trim_sgr0.c

17
NEWS
View File

@ -25,7 +25,7 @@
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
-------------------------------------------------------------------------------
-- $Id: NEWS,v 1.2014 2013/01/20 01:05:06 tom Exp $
-- $Id: NEWS,v 1.2018 2013/01/27 01:52:49 tom Exp $
-------------------------------------------------------------------------------
This is a log of changes that ncurses has gone through since Zeyd started
@ -45,6 +45,21 @@ 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.
20130126
+ further fixes to mvcur to pass callback function (cf: 20130112),
needed to make test/dots_mvcur work.
+ reduce calls to SetConsoleActiveScreenBuffer in win_driver.c, to
help reduce flicker.
+ modify configure script to omit "+b" from linker options for very
old HP-UX systems (report by Dennis Grevenstein)
+ add HP-UX workaround for missing EILSEQ on old HP-UX systems (patch
by Dennis Grevenstein).
+ restore memmove/strdup support for antique systems (request by
Dennis Grevenstein).
+ change %l behavior in tparm to push the string length onto the stack
rather than saving the formatted length into the output buffer
(report by Roy Marples, cf: 980620).
20130119
+ fixes for issues found by Coverity:
+ fix memory leak in safe_sprintf.c

69
aclocal.m4 vendored
View File

@ -1,5 +1,5 @@
dnl***************************************************************************
dnl Copyright (c) 1998-2011,2012 Free Software Foundation, Inc. *
dnl Copyright (c) 1998-2012,2013 Free Software Foundation, Inc. *
dnl *
dnl Permission is hereby granted, free of charge, to any person obtaining a *
dnl copy of this software and associated documentation files (the *
@ -28,7 +28,7 @@ dnl***************************************************************************
dnl
dnl Author: Thomas E. Dickey 1995-on
dnl
dnl $Id: aclocal.m4,v 1.644 2012/12/23 00:45:32 tom Exp $
dnl $Id: aclocal.m4,v 1.648 2013/01/26 21:29:17 tom Exp $
dnl Macros used in NCURSES auto-configuration script.
dnl
dnl These macros are maintained separately from NCURSES. The copyright on
@ -1306,7 +1306,7 @@ AC_ARG_ENABLE(rpath,
AC_MSG_RESULT($cf_cv_enable_rpath)
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_ENABLE_STRING_HACKS version: 2 updated: 2012/10/06 17:56:13
dnl CF_ENABLE_STRING_HACKS version: 3 updated: 2013/01/26 16:26:12
dnl ----------------------
dnl On a few platforms, the compiler and/or loader nags with untruthful
dnl comments stating that "most" uses of strcat/strcpy/sprintf are incorrect,
@ -1325,7 +1325,7 @@ AC_DEFUN([CF_ENABLE_STRING_HACKS],
[
AC_MSG_CHECKING(if you want to work around bogus compiler/loader warnings)
AC_ARG_ENABLE(string-hacks,
[ --enable-string-hacks work around bogus compiler/loader warnings],
[ --enable-string-hacks work around bogus compiler/loader warnings],
[with_string_hacks=$enableval],
[with_string_hacks=no])
AC_MSG_RESULT($with_string_hacks)
@ -1565,6 +1565,37 @@ else
fi
])
dnl ---------------------------------------------------------------------------
dnl CF_FUNC_MEMMOVE version: 8 updated: 2012/10/04 20:12:20
dnl ---------------
dnl Check for memmove, or a bcopy that can handle overlapping copy. If neither
dnl is found, add our own version of memmove to the list of objects.
AC_DEFUN([CF_FUNC_MEMMOVE],
[
AC_CHECK_FUNC(memmove,,[
AC_CHECK_FUNC(bcopy,[
AC_CACHE_CHECK(if bcopy does overlapping moves,cf_cv_good_bcopy,[
AC_TRY_RUN([
int main() {
static char data[] = "abcdefghijklmnopqrstuwwxyz";
char temp[40];
bcopy(data, temp, sizeof(data));
bcopy(temp+10, temp, 15);
bcopy(temp+5, temp+15, 10);
${cf_cv_main_return:-return} (strcmp(temp, "klmnopqrstuwwxypqrstuwwxyz"));
}
],
[cf_cv_good_bcopy=yes],
[cf_cv_good_bcopy=no],
[cf_cv_good_bcopy=unknown])
])
],[cf_cv_good_bcopy=no])
if test "$cf_cv_good_bcopy" = yes ; then
AC_DEFINE(USE_OK_BCOPY,1,[Define to 1 to use bcopy when memmove is unavailable])
else
AC_DEFINE(USE_MY_MEMMOVE,1,[Define to 1 to use replacement function when memmove is unavailable])
fi
])])dnl
dnl ---------------------------------------------------------------------------
dnl CF_FUNC_NANOSLEEP version: 4 updated: 2012/10/06 17:56:13
dnl -----------------
dnl Check for existence of workable nanosleep() function. Some systems, e.g.,
@ -5227,7 +5258,7 @@ CF_VERBOSE(...checked $1 [$]$1)
AC_SUBST(EXTRA_LDFLAGS)
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_SHARED_OPTS version: 71 updated: 2012/12/22 19:34:47
dnl CF_SHARED_OPTS version: 72 updated: 2013/01/26 16:26:12
dnl --------------
dnl --------------
dnl Attempt to determine the appropriate CC/LD options for creating a shared
@ -5350,6 +5381,14 @@ CF_EOF
LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
fi
;;
hpux[[7-8]]*) #(vi
# HP-UX 8.07 ld lacks "+b" option used for libdir search-list
if test "$GCC" != yes; then
CC_SHARED_OPTS='+Z'
fi
MK_SHARED_LIB='${LD} -b -o $[@]'
INSTALL_LIB="-m 555"
;;
hpux*) #(vi
# (tested with gcc 2.7.2 -- I don't have c89)
if test "$GCC" = yes; then
@ -6906,6 +6945,26 @@ test "$cf_with_sysmouse" = yes && AC_DEFINE(USE_SYSMOUSE,1,[Define to 1 if we ca
fi
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_WITH_SYSTYPE version: 1 updated: 2013/01/26 16:26:12
dnl ---------------
dnl For testing, override the derived host system-type which is used to decide
dnl things such as the linker commands used to build shared libraries. This is
dnl normally chosen automatically based on the type of system which you are
dnl building on. We use it for testing the configure script.
dnl
dnl This is different from the --host option: it is used only for testing parts
dnl of the configure script which would not be reachable with --host since that
dnl relies on the build environment being real, rather than mocked up.
AC_DEFUN([CF_WITH_SYSTYPE],[
CF_CHECK_CACHE([AC_CANONICAL_SYSTEM])
AC_ARG_WITH(system-type,
[ --with-system-type=XXX test: override derived host system-type],
[AC_MSG_WARN(overriding system type to $withval)
cf_cv_system_name=$withval
host_os=$withval
])
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_WITH_VALGRIND version: 1 updated: 2006/12/14 18:00:21
dnl ----------------
AC_DEFUN([CF_WITH_VALGRIND],[

3761
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -28,14 +28,14 @@ dnl***************************************************************************
dnl
dnl Author: Thomas E. Dickey 1995-on
dnl
dnl $Id: configure.in,v 1.560 2012/11/03 19:39:31 tom Exp $
dnl $Id: configure.in,v 1.562 2013/01/26 20:59:15 tom Exp $
dnl Process this file with autoconf to produce a configure script.
dnl
dnl See http://invisible-island.net/autoconf/ for additional information.
dnl
dnl ---------------------------------------------------------------------------
AC_PREREQ(2.52.20030208)
AC_REVISION($Revision: 1.560 $)
AC_REVISION($Revision: 1.562 $)
AC_INIT(ncurses/base/lib_initscr.c)
AC_CONFIG_HEADER(include/ncurses_cfg.h:include/ncurses_cfg.hin)
@ -45,11 +45,7 @@ CF_SUBST_NCURSES_VERSION
CF_WITH_REL_VERSION(NCURSES)
CF_WITH_ABI_VERSION
CF_CHECK_CACHE([AC_CANONICAL_SYSTEM])
AC_ARG_WITH(system-type,
[ --with-system-type=XXX test: override derived host system-type],
[AC_MSG_WARN(overriding system type to $withval)
cf_cv_system_name=$withval])
CF_WITH_SYSTYPE
### Save the given $CFLAGS to allow user-override.
cf_user_CFLAGS="$CFLAGS"
@ -479,7 +475,7 @@ AC_SUBST(WHICH_XTERM)
AC_MSG_CHECKING(if xterm backspace sends BS or DEL)
AC_ARG_WITH(xterm-kbs,
[ --with-xterm-kbs=XXX specify if xterm backspace sends BS or DEL],
[ --with-xterm-kbs=XXX specify if xterm backspace sends BS or DEL],
[with_xterm_kbs=$withval],
[with_xterm_kbs=BS])
case x$with_xterm_kbs in
@ -1409,6 +1405,7 @@ setenv \
setvbuf \
sigaction \
sigvec \
strdup \
strstr \
tcgetpgrp \
times \
@ -1438,6 +1435,7 @@ AC_TYPE_SIGNAL
AC_CHECK_TYPE(intptr_t, long)
CF_TYPE_SIGACTION
CF_SIZECHANGE
CF_FUNC_MEMMOVE
CF_FUNC_POLL
CF_VA_COPY
AC_FUNC_VFORK

View File

@ -25,7 +25,7 @@
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
# $Id: dist.mk,v 1.910 2013/01/19 13:54:45 tom Exp $
# $Id: dist.mk,v 1.911 2013/01/26 15:53:06 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 = 20130119
NCURSES_PATCH = 20130126
# We don't append the patch to the version, since this only applies to releases
VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998-2011,2012 Free Software Foundation, Inc. *
* Copyright (c) 1998-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 *
@ -29,7 +29,7 @@
/****************************************************************************
* Author: Thomas E. Dickey 1996-on *
****************************************************************************/
/* $Id: nc_alloc.h,v 1.20 2012/11/03 19:31:35 tom Exp $ */
/* $Id: nc_alloc.h,v 1.22 2013/01/26 21:56:51 tom Exp $ */
#ifndef NC_ALLOC_included
#define NC_ALLOC_included 1
@ -94,6 +94,11 @@ extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_free_and_exit)(SCREEN*, int) GCC
/* doalloc.c */
extern NCURSES_EXPORT(void *) _nc_doalloc(void *, size_t);
#if !HAVE_STRDUP
#undef strdup
#define strdup _nc_strdup
extern NCURSES_EXPORT(char *) _nc_strdup(const char *);
#endif
/* entries.c */
extern NCURSES_EXPORT(void) _nc_leaks_tinfo(void);

View File

@ -1,6 +1,6 @@
# $Id: ncurses_defs,v 1.57 2012/11/03 19:42:04 tom Exp $
# $Id: ncurses_defs,v 1.58 2013/01/26 20:12:26 tom Exp $
##############################################################################
# Copyright (c) 2000-2011,2012 Free Software Foundation, Inc. #
# Copyright (c) 2000-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 "Software"), #
@ -128,6 +128,7 @@ HAVE_SLK_COLOR
HAVE_SLK_INIT 1
HAVE_SNPRINTF
HAVE_STDINT_H
HAVE_STRDUP
HAVE_STRLCAT
HAVE_STRLCPY
HAVE_STRSTR
@ -207,6 +208,8 @@ USE_HASHED_DB
USE_HASHMAP
USE_HOME_TERMINFO
USE_LINKS
USE_MY_MEMMOVE
USE_OK_BCOPY
USE_PTHREADS_EINTR
USE_RCS_IDS
USE_REENTRANT

View File

@ -34,7 +34,7 @@
****************************************************************************/
/*
* $Id: curses.priv.h,v 1.521 2013/01/12 21:53:35 tom Exp $
* $Id: curses.priv.h,v 1.523 2013/01/26 21:51:56 tom Exp $
*
* curses.priv.h
*
@ -86,6 +86,12 @@ extern "C" {
#include <errno.h>
#if defined __hpux
# ifndef EILSEQ
# define EILSEQ 47
# endif
#endif
#ifndef PATH_MAX
# if defined(_POSIX_PATH_MAX)
# define PATH_MAX _POSIX_PATH_MAX
@ -184,6 +190,17 @@ extern int errno;
extern NCURSES_EXPORT(int) _nc_env_access (void);
#endif
/*
* Not all platforms have memmove; some have an equivalent bcopy. (Some may
* have neither).
*/
#if USE_OK_BCOPY
#define memmove(d,s,n) bcopy(s,d,n)
#elif USE_MY_MEMMOVE
#define memmove(d,s,n) _nc_memmove(d,s,n)
extern NCURSES_EXPORT(void *) _nc_memmove (void *, const void *, size_t);
#endif
/*
* If we have va_copy(), use it for assigning va_list's.
*/

View File

@ -1,6 +1,6 @@
# $Id: modules,v 1.119 2012/12/02 00:51:44 tom Exp $
# $Id: modules,v 1.120 2013/01/26 22:17:55 tom Exp $
##############################################################################
# Copyright (c) 1998-2010,2012 Free Software Foundation, Inc. #
# Copyright (c) 1998-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 "Software"), #
@ -198,9 +198,9 @@ lib_ttyflags lib $(tinfo) $(HEADER_DEPS)
lib_twait lib $(serial) $(HEADER_DEPS)
name_match lib $(tinfo) $(HEADER_DEPS) $(INCDIR)/tic.h
names lib . $(HEADER_DEPS)
obsolete lib $(tinfo) $(HEADER_DEPS)
read_entry lib $(tinfo) $(HEADER_DEPS) $(INCDIR)/tic.h $(INCDIR)/hashed_db.h
read_termcap lib $(tinfo) $(HEADER_DEPS) $(INCDIR)/tic.h
setbuf lib $(tinfo) $(HEADER_DEPS)
strings lib $(tinfo) $(HEADER_DEPS)
trace_buf lib $(trace) $(HEADER_DEPS)
trace_tries lib $(trace) $(HEADER_DEPS)

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998-2011,2012 Free Software Foundation, Inc. *
* Copyright (c) 1998-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 *
@ -42,7 +42,7 @@
#include <ctype.h>
#include <tic.h>
MODULE_ID("$Id: lib_tparm.c,v 1.87 2012/10/27 21:28:21 tom Exp $")
MODULE_ID("$Id: lib_tparm.c,v 1.88 2013/01/26 17:07:05 tom Exp $")
/*
* char *
@ -561,7 +561,7 @@ tparam_internal(int use_TPARM_ARG, const char *string, va_list ap)
break;
case 'l':
save_number("%d", (int) strlen(spop()), 0);
npush((int) strlen(spop()));
break;
case 's':

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998-2011,2012 Free Software Foundation, Inc. *
* Copyright (c) 1998-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 *
@ -44,7 +44,7 @@
#include <ctype.h>
MODULE_ID("$Id: make_hash.c,v 1.10 2012/12/16 00:40:14 tom Exp $")
MODULE_ID("$Id: make_hash.c,v 1.11 2013/01/26 22:00:11 tom Exp $")
/*
* _nc_make_hash_table()
@ -59,6 +59,23 @@ MODULE_ID("$Id: make_hash.c,v 1.10 2012/12/16 00:40:14 tom Exp $")
#define MODULE_ID(id) /*nothing */
#include <tinfo/doalloc.c>
static void
failed(const char *s)
{
perror(s);
exit(EXIT_FAILURE);
}
static char *
strmalloc(char *s)
{
char *result = malloc(strlen(s) + 1);
if (result == 0)
failed("strmalloc");
strcpy(result, s);
return result;
}
/*
* int hash_function(string)
*
@ -221,7 +238,7 @@ main(int argc, char **argv)
exit(EXIT_FAILURE);
}
name_table[n].nte_link = -1; /* end-of-hash */
name_table[n].nte_name = strdup(list[column]);
name_table[n].nte_name = strmalloc(list[column]);
if (!strcmp(list[2], "bool")) {
name_table[n].nte_type = BOOLEAN;
name_table[n].nte_index = BoolCount++;

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998-2011,2012 Free Software Foundation, Inc. *
* Copyright (c) 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 *
@ -27,22 +27,16 @@
****************************************************************************/
/****************************************************************************
* Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 *
* and: Eric S. Raymond <esr@snark.thyrsus.com> *
* and: Thomas E. Dickey 1996-on *
* and: Juergen Pfeifer 2008 *
* Author: Thomas E. Dickey 2013 *
****************************************************************************/
/*
** setbuf.c
**
** Support for set_term(), reset_shell_mode(), reset_prog_mode().
**
** Support for obsolete features.
*/
#include <curses.priv.h>
MODULE_ID("$Id: setbuf.c,v 1.19 2012/08/25 20:48:05 tom Exp $")
MODULE_ID("$Id: obsolete.c,v 1.1 2013/01/26 22:07:51 tom Exp $")
/*
* Obsolete entrypoint retained for binary compatbility.
@ -64,3 +58,45 @@ _nc_set_buffer(FILE *ofp, int buffered)
NCURSES_SP_NAME(_nc_set_buffer) (CURRENT_SCREEN, ofp, buffered);
}
#endif
#if !HAVE_STRDUP
NCURSES_EXPORT(char *)
_nc_strdup(const char *s)
{
char *result = 0;
if (s != 0) {
size_t need = strlen(s);
result = malloc(need + 1);
if (result != 0) {
strcpy(result, s);
}
}
return result;
}
#endif
#if USE_MY_MEMMOVE
#define DST ((char *)s1)
#define SRC ((const char *)s2)
NCURSES_EXPORT(void *)
_nc_memmove(void *s1, const void *s2, size_t n)
{
if (n != 0) {
if ((DST + n > SRC) && (SRC + n > DST)) {
static char *bfr;
static size_t length;
register size_t j;
if (length < n) {
length = (n * 3) / 2;
bfr = typeRealloc(char, length, bfr);
}
for (j = 0; j < n; j++)
bfr[j] = SRC[j];
s2 = bfr;
}
while (n-- != 0)
DST[n] = SRC[n];
}
return s1;
}
#endif /* USE_MY_MEMMOVE */

View File

@ -159,7 +159,7 @@
#define CUR SP_TERMTYPE
#endif
MODULE_ID("$Id: lib_mvcur.c,v 1.131 2013/01/12 22:21:29 tom Exp $")
MODULE_ID("$Id: lib_mvcur.c,v 1.132 2013/01/27 01:40:01 tom Exp $")
#define WANT_CHAR(sp, y, x) NewScreen(sp)->_line[y].text[x] /* desired state */
@ -769,7 +769,10 @@ relative_move(NCURSES_SP_DCLx
*/
static NCURSES_INLINE int
onscreen_mvcur(NCURSES_SP_DCLx int yold, int xold, int ynew, int xnew, int ovw)
onscreen_mvcur(NCURSES_SP_DCLx
int yold, int xold,
int ynew, int xnew, int ovw,
NCURSES_SP_OUTC myOutCh)
/* onscreen move from (yold, xold) to (ynew, xnew) */
{
string_desc result;
@ -934,7 +937,7 @@ onscreen_mvcur(NCURSES_SP_DCLx int yold, int xold, int ynew, int xnew, int ovw)
if (usecost != INFINITY) {
TPUTS_TRACE("mvcur");
NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx
buffer, 1, NCURSES_SP_NAME(_nc_outch));
buffer, 1, myOutCh);
SP_PARM->_cursrow = ynew;
SP_PARM->_curscol = xnew;
return (OK);
@ -1000,14 +1003,14 @@ _nc_real_mvcur(NCURSES_SP_DCLx
if (carriage_return) {
NCURSES_PUTP2("carriage_return", carriage_return);
} else
NCURSES_SP_NAME(_nc_outch) (NCURSES_SP_ARGx '\r');
myOutCh(NCURSES_SP_ARGx '\r');
xold = 0;
while (l > 0) {
if (newline) {
NCURSES_PUTP2("newline", newline);
} else
NCURSES_SP_NAME(_nc_outch) (NCURSES_SP_ARGx '\n');
myOutCh(NCURSES_SP_ARGx '\n');
l--;
}
}
@ -1027,7 +1030,7 @@ _nc_real_mvcur(NCURSES_SP_DCLx
ynew = screen_lines(SP_PARM) - 1;
/* destination location is on screen now */
code = onscreen_mvcur(NCURSES_SP_ARGx yold, xold, ynew, xnew, TRUE);
code = onscreen_mvcur(NCURSES_SP_ARGx yold, xold, ynew, xnew, TRUE, myOutCh);
/*
* Restore attributes if we disabled them before moving.

View File

@ -38,7 +38,7 @@
#include <curses.priv.h>
#define CUR my_term.type.
MODULE_ID("$Id: win_driver.c,v 1.16 2013/01/05 23:16:54 tom Exp $")
MODULE_ID("$Id: win_driver.c,v 1.17 2013/01/27 00:47:42 tom Exp $")
#define WINMAGIC NCDRV_MAGIC(NCDRV_WINCONSOLE)
@ -70,6 +70,7 @@ static const LONG keylist[] =
typedef struct props {
CONSOLE_SCREEN_BUFFER_INFO SBI;
bool progMode;
TERM_HANDLE lastOut;
DWORD map[MAPSIZE];
DWORD rmap[MAPSIZE];
WORD pairs[NUMPAIRS];
@ -323,6 +324,15 @@ find_next_change(SCREEN *sp, int row, int col)
win->_line[row].firstchar = _NOCHANGE; \
win->_line[row].lastchar = _NOCHANGE
static void
selectActiveHandle(TERMINAL_CONTROL_BLOCK * TCB)
{
if (PropOf(TCB)->lastOut != TCB->hdl) {
PropOf(TCB)->lastOut = TCB->hdl;
SetConsoleActiveScreenBuffer(PropOf(TCB)->lastOut);
}
}
static int
drv_doupdate(TERMINAL_CONTROL_BLOCK * TCB)
{
@ -431,7 +441,7 @@ drv_doupdate(TERMINAL_CONTROL_BLOCK * TCB)
TCB->drv->hwcur(TCB, 0, 0, CurScreen(sp)->_cury, CurScreen(sp)->_curx);
}
SetConsoleActiveScreenBuffer(TCB->hdl);
selectActiveHandle(TCB);
return OK;
}
@ -668,7 +678,8 @@ drv_mode(TERMINAL_CONTROL_BLOCK * TCB, int progFlag, int defFlag)
sp = TCB->csp;
PropOf(TCB)->progMode = progFlag;
SetConsoleActiveScreenBuffer(progFlag ? TCB->hdl : TCB->out);
PropOf(TCB)->lastOut = progFlag ? TCB->hdl : TCB->out;
SetConsoleActiveScreenBuffer(PropOf(TCB)->lastOut);
if (progFlag) /* prog mode */ {
if (defFlag) {
@ -1178,8 +1189,7 @@ drv_twait(TERMINAL_CONTROL_BLOCK * TCB,
}
continue;
default:
SetConsoleActiveScreenBuffer(!PropOf(TCB)->progMode ?
TCB->hdl : TCB->out);
selectActiveHandle(TCB);
continue;
}
}

View File

@ -1,4 +1,4 @@
ncurses6 (5.9-20130119) unstable; urgency=low
ncurses6 (5.9-20130126) unstable; urgency=low
* latest weekly patch

View File

@ -1,7 +1,7 @@
Summary: shared libraries for terminal handling
Name: ncurses6
Release: 5.9
Version: 20130119
Version: 20130126
License: X11
Group: Development/Libraries
Source: ncurses-%{release}-%{version}.tgz