From: Thomas E. Dickey Date: Sat, 22 Sep 2012 23:21:49 +0000 (+0000) Subject: ncurses 5.9 - patch 20120922 X-Git-Tag: v6.0~135 X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=commitdiff_plain;h=cabcc699fe87c3982b795dabea1ba6970b4faa90 ncurses 5.9 - patch 20120922 + modify setupterm to set its copy of TERM to "unknown" if configured for the terminal driver and TERM was null or empty. + modify treatment of TERM variable for MinGW port to allow explicit use of the windows console driver by checking if $TERM is set to "#win32con" or an abbreviation of that. + undo recent change to fallback definition of vsscanf() to build with older Solaris compilers (cf: 20120728). to help with MinGW port. + modifications for MinGW port to make wide-character display usable. --- diff --git a/NEWS b/NEWS index f7fa197d..44818dfa 100644 --- a/NEWS +++ b/NEWS @@ -25,7 +25,7 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------- --- $Id: NEWS,v 1.1953 2012/09/08 22:05:39 tom Exp $ +-- $Id: NEWS,v 1.1957 2012/09/22 20:11:31 tom Exp $ ------------------------------------------------------------------------------- This is a log of changes that ncurses has gone through since Zeyd started @@ -45,14 +45,23 @@ 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. +20120922 + + modify setupterm to set its copy of TERM to "unknown" if configured + for the terminal driver and TERM was null or empty. + + modify treatment of TERM variable for MinGW port to allow explicit + use of the windows console driver by checking if $TERM is set to + "#win32con" or an abbreviation of that. + + undo recent change to fallback definition of vsscanf() to build with + older Solaris compilers (cf: 20120728). + 20120908 + add test-screens to test/ncurses to show 256-characters at a time, - to help with mingw port. + to help with MinGW port. 20120903 + simplify varargs logic in lib_printw.c; va_copy is no longer needed there. - + modifications for mingw port to make wide-character display usable. + + modifications for MinGW port to make wide-character display usable. 20120902 + regenerate configure script (report by Sven Joachim, cf: 20120901). diff --git a/README.MinGW b/README.MinGW index f879f3b3..f7d78977 100644 --- a/README.MinGW +++ b/README.MinGW @@ -25,7 +25,7 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------- --- $Id: README.MinGW,v 1.8 2012/01/21 23:55:33 tom Exp $ +-- $Id: README.MinGW,v 1.9 2012/09/22 17:46:04 tom Exp $ -- Author: Juergen Pfeifer ------------------------------------------------------------------------------- @@ -55,8 +55,9 @@ to provide the includes, libraries and DLLs to be used with the more common traditional development environments on Windows, mainly with Microsoft Visual Studio. -It is necessary to unset the TERM environment variable, to activate the -Windows console-driver. +The TERM environment variable must be set specially to active the Windows +console-driver. The driver checks if TERM is set to "#win32con" (explicit +use) or if TERM is unset or empty (implicit). Please also make sure that MSYS links to the correct directory containing your MinGW toolchain. For TDM this is usually C:\MinGW64. In your Windows @@ -83,7 +84,9 @@ hooks for interop, I recommend using these options: --enable-term-driver --enable-interop -This is the configuration commandline as I'm using it at the moment (assuming environment variable MINGW_ROOT to hold the root directory name of your MinGW build): +This is the configuration commandline as I'm using it at the moment (assuming +environment variable MINGW_ROOT to hold the root directory name of your MinGW +build): ./configure \ --prefix=$MINGW_ROOT \ @@ -120,7 +123,7 @@ experimental. A lot is still TODO, e.g.: - - Wide Character support + - Wide Character support (display is workable, but input untested) The Win32Con driver should actually only use Unicode in the future. - Thread support (locking). If using TDM toolchain this is done by @@ -131,5 +134,5 @@ A lot is still TODO, e.g.: - Workarounds for MinGW's filesystem access are necessary to make infocmp work (though tic works). -To support terminfo, we need to have an ioctl() simulation for the -serial and networked Terminals. +To support terminfo, we would need to have an ioctl() simulation for the +serial and networked terminals. diff --git a/dist.mk b/dist.mk index fe343119..30c3298b 100644 --- a/dist.mk +++ b/dist.mk @@ -25,7 +25,7 @@ # use or other dealings in this Software without prior written # # authorization. # ############################################################################## -# $Id: dist.mk,v 1.892 2012/09/08 15:40:37 tom Exp $ +# $Id: dist.mk,v 1.893 2012/09/22 17:49:36 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 = 20120908 +NCURSES_PATCH = 20120922 # We don't append the patch to the version, since this only applies to releases VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR) diff --git a/include/curses.h.in b/include/curses.h.in index 526526a8..361711ca 100644 --- a/include/curses.h.in +++ b/include/curses.h.in @@ -32,7 +32,7 @@ * and: Thomas E. Dickey 1996-on * ****************************************************************************/ -/* $Id: curses.h.in,v 1.232 2012/07/28 18:17:43 tom Exp $ */ +/* $Id: curses.h.in,v 1.233 2012/09/16 21:05:02 tom Exp $ */ #ifndef __NCURSES_H #define __NCURSES_H @@ -1311,7 +1311,7 @@ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(use_legacy_coding) (SCREEN*, int); /* * Export fallback function for use in C++ binding. */ #if !@HAVE_VSSCANF@ -#define vsscanf(a,b,c) _nc_vsscanf((a),(b),(c)) +#define vsscanf(a,b,c) _nc_vsscanf(a,b,c) NCURSES_EXPORT(int) vsscanf(const char *, const char *, va_list); #endif diff --git a/ncurses/base/lib_driver.c b/ncurses/base/lib_driver.c index 40487609..6301a588 100644 --- a/ncurses/base/lib_driver.c +++ b/ncurses/base/lib_driver.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2008-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 2008-2010,2012 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 @@ #include -MODULE_ID("$Id: lib_driver.c,v 1.3 2010/12/20 00:29:17 tom Exp $") +MODULE_ID("$Id: lib_driver.c,v 1.4 2012/09/22 19:32:46 tom Exp $") typedef struct DriverEntry { const char *name; @@ -43,9 +43,9 @@ typedef struct DriverEntry { static DRIVER_ENTRY DriverTable[] = { #ifdef __MINGW32__ - {"win", &_nc_WIN_DRIVER}, + {"win32con", &_nc_WIN_DRIVER}, #endif - {"tinfo", &_nc_TINFO_DRIVER} + {"tinfo", &_nc_TINFO_DRIVER} /* must be last */ }; NCURSES_EXPORT(int) @@ -63,6 +63,20 @@ _nc_get_driver(TERMINAL_CONTROL_BLOCK * TCB, const char *name, int *errret) for (i = 0; i < SIZEOF(DriverTable); i++) { res = DriverTable[i].driver; + /* + * Use "#" (a character which cannot begin a terminal's name) to + * select specific driver from the table. + * + * In principle, we could have more than one non-terminfo driver, + * e.g., "win32gui". + */ + if (name != 0 && *name == '#') { + size_t n = strlen(name + 1); + if (n != 0 + && strncmp(name + 1, DriverTable[i].name, n)) { + continue; + } + } if (res->CanHandle(TCB, name, errret)) { use = res; break; diff --git a/ncurses/tinfo/lib_setup.c b/ncurses/tinfo/lib_setup.c index 51030b6b..60ce2c68 100644 --- a/ncurses/tinfo/lib_setup.c +++ b/ncurses/tinfo/lib_setup.c @@ -48,7 +48,7 @@ #include #endif -MODULE_ID("$Id: lib_setup.c,v 1.149 2012/09/03 16:19:14 tom Exp $") +MODULE_ID("$Id: lib_setup.c,v 1.150 2012/09/22 18:46:12 tom Exp $") /**************************************************************************** * @@ -636,7 +636,11 @@ TINFO_SETUP_TERM(TERMINAL ** tp, if (tname == 0) { tname = getenv("TERM"); if (tname == 0 || *tname == '\0') { +#ifdef USE_TERM_DRIVER + tname = "unknown"; +#else ret_error0(TGETENT_ERR, "TERM environment variable not set.\n"); +#endif } } diff --git a/ncurses/win32con/win_driver.c b/ncurses/win32con/win_driver.c index afc1a168..02cd378c 100644 --- a/ncurses/win32con/win_driver.c +++ b/ncurses/win32con/win_driver.c @@ -38,7 +38,7 @@ #include #define CUR my_term.type. -MODULE_ID("$Id: win_driver.c,v 1.13 2012/09/03 16:20:24 tom Exp $") +MODULE_ID("$Id: win_driver.c,v 1.14 2012/09/22 19:15:14 tom Exp $") #define WINMAGIC NCDRV_MAGIC(NCDRV_WINCONSOLE) @@ -340,7 +340,7 @@ drv_CanHandle(TERMINAL_CONTROL_BLOCK * TCB, assert(tname != 0); TCB->magic = WINMAGIC; - if (*tname == 0 || *tname == 0) { + if (*tname == 0 || *tname == 0 || *tname == '#') { code = TRUE; } else { TERMINAL my_term; diff --git a/package/debian/changelog b/package/debian/changelog index 5e8e56f9..f2fdb19d 100644 --- a/package/debian/changelog +++ b/package/debian/changelog @@ -1,8 +1,8 @@ -ncurses6 (5.9-20120908) unstable; urgency=low +ncurses6 (5.9-20120922) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Sat, 08 Sep 2012 14:28:23 -0400 + -- Thomas E. Dickey Sat, 22 Sep 2012 13:50:11 -0400 ncurses6 (5.9-20120608) unstable; urgency=low diff --git a/package/ncurses.spec b/package/ncurses.spec index fa467ea2..49a38d19 100644 --- a/package/ncurses.spec +++ b/package/ncurses.spec @@ -1,7 +1,7 @@ Summary: shared libraries for terminal handling Name: ncurses6 Release: 5.9 -Version: 20120908 +Version: 20120922 License: X11 Group: Development/Libraries Source: ncurses-%{release}-%{version}.tgz