]> ncurses.scripts.mit.edu Git - ncurses.git/commitdiff
ncurses 5.7 - patch 20081206
authorThomas E. Dickey <dickey@invisible-island.net>
Sun, 7 Dec 2008 01:42:58 +0000 (01:42 +0000)
committerThomas E. Dickey <dickey@invisible-island.net>
Sun, 7 Dec 2008 01:42:58 +0000 (01:42 +0000)
+ move del_curterm() call from _nc_freeall() to _nc_leaks_tinfo() to
  work for progs/clear, progs/tabs, etc.
+ correct buffer-size after internal resizing of wide-character
  set_field_buffer(), broken in 20081018 changes (report by Mike Gran).
+ add "-i" option to test/filter.c to tell it to use initscr() rather
  than newterm(), to investigate report on comp.unix.programmer that
  ncurses would clear the screen in that case (it does not - the issue
  was xterm's alternate screen feature).
+ add check in mouse-driver to disable connection if GPM returns a
  zero, indicating that the connection is closed (Debian #506717,
  adapted from patch by Samuel Thibault).

NEWS
dist.mk
form/frm_driver.c
ncurses/base/lib_freeall.c
ncurses/base/lib_mouse.c
ncurses/tinfo/entries.c
test/filter.c

diff --git a/NEWS b/NEWS
index abb90aac8b7ebc40775ffcad1be6d85c48897f9f..f58b36c44755517d6f0fa191378fc18201fa463e 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.1330 2008/11/29 21:08:00 tom Exp $
+-- $Id: NEWS,v 1.1334 2008/12/07 00:12:46 tom Exp $
 -------------------------------------------------------------------------------
 
 This is a log of changes that ncurses has gone through since Zeyd started
@@ -45,6 +45,19 @@ 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.
 
+20081206
+       + move del_curterm() call from _nc_freeall() to _nc_leaks_tinfo() to
+         work for progs/clear, progs/tabs, etc.
+       + correct buffer-size after internal resizing of wide-character
+         set_field_buffer(), broken in 20081018 changes (report by Mike Gran).
+       + add "-i" option to test/filter.c to tell it to use initscr() rather
+         than newterm(), to investigate report on comp.unix.programmer that
+         ncurses would clear the screen in that case (it does not - the issue
+         was xterm's alternate screen feature).
+       + add check in mouse-driver to disable connection if GPM returns a
+         zero, indicating that the connection is closed (Debian #506717,
+         adapted from patch by Samuel Thibault).
+
 20081129
        + improve a workaround in adding wide-characters, when a control
          character is found.  The library (cf: 20040207) uses unctrl() to
diff --git a/dist.mk b/dist.mk
index c5fb80cecd25d6b0624d8c8c95413ab75761eab9..a758387a2e25ec1e4dedba94a9a71eae99e99c80 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.674 2008/11/28 16:15:46 tom Exp $
+# $Id: dist.mk,v 1.675 2008/12/06 21:19:42 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 = 7
-NCURSES_PATCH = 20081129
+NCURSES_PATCH = 20081206
 
 # We don't append the patch to the version, since this only applies to releases
 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
index 94323ed27788288e74dab5987dc0e40da01c207f..e5db6cbca8ff98358aeafb15aa0e73284744a099 100644 (file)
@@ -32,7 +32,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: frm_driver.c,v 1.88 2008/10/18 16:25:00 tom Exp $")
+MODULE_ID("$Id: frm_driver.c,v 1.89 2008/12/06 23:08:12 tom Exp $")
 
 /*----------------------------------------------------------------------------
   This is the core module of the form library. It contains the majority
@@ -4366,6 +4366,7 @@ set_field_buffer(FIELD *field, int buffer, const char *value)
       delwin(field->working);
       field->working = newpad(field->drows, field->dcols);
     }
+  len = Buffer_Length(field);
   wclear(field->working);
   mvwaddstr(field->working, 0, 0, value);
 
index 5640265829111e054ec44cf66fcda3397babe591..61991816361424d739cdd8f26ce1c13db5914194 100644 (file)
@@ -40,7 +40,7 @@
 extern int malloc_errfd;       /* FIXME */
 #endif
 
-MODULE_ID("$Id: lib_freeall.c,v 1.54 2008/09/27 13:09:57 tom Exp $")
+MODULE_ID("$Id: lib_freeall.c,v 1.55 2008/12/06 23:52:29 tom Exp $")
 
 /*
  * Free all ncurses data.  This is used for testing only (there's no practical
@@ -98,8 +98,6 @@ _nc_freeall(void)
        delscreen(SP);
        _nc_unlock_global(curses);
     }
-    if (cur_term != 0)
-       del_curterm(cur_term);
 
     (void) _nc_printf_string(0, empty_va);
 #ifdef TRACE
index 83f63a009143bfeff467a25b19c219058955db0e..d19189f7d6e97eac6555569ae780126949d05a36 100644 (file)
@@ -79,7 +79,7 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_mouse.c,v 1.103 2008/11/23 00:11:46 tom Exp $")
+MODULE_ID("$Id: lib_mouse.c,v 1.104 2008/11/30 01:37:27 tom Exp $")
 
 #include <term.h>
 #include <tic.h>
@@ -694,11 +694,16 @@ _nc_mouse_event(SCREEN *sp GCC_UNUSED)
 
 #if USE_GPM_SUPPORT
     case M_GPM:
-       {
+       if (sp->_mouse_fd >= 0) {
            /* query server for event, return TRUE if we find one */
            Gpm_Event ev;
 
-           if (my_Gpm_GetEvent(&ev) == 1) {
+           switch (my_Gpm_GetEvent(&ev)) {
+           case 0:
+               /* Connection closed, drop the mouse. */
+               sp->_mouse_fd = -1;
+               break;
+           case 1:
                /* there's only one mouse... */
                eventp->id = NORMAL_EVENT;
 
@@ -731,6 +736,7 @@ _nc_mouse_event(SCREEN *sp GCC_UNUSED)
                /* bump the next-free pointer into the circular list */
                sp->_mouse_eventp = eventp = NEXT(eventp);
                result = TRUE;
+               break;
            }
        }
        break;
index cf2a8337b870ce931f67d670ed6259086fccd522..b7d64de7ab0ff8fb3da57d9460cc8823aa7b4345 100644 (file)
@@ -37,7 +37,7 @@
 #include <tic.h>
 #include <term_entry.h>
 
-MODULE_ID("$Id: entries.c,v 1.8 2008/09/27 13:11:10 tom Exp $")
+MODULE_ID("$Id: entries.c,v 1.10 2008/12/07 00:11:45 tom Exp $")
 
 /****************************************************************************
  *
@@ -117,6 +117,9 @@ _nc_leaks_tinfo(void)
 
     T((T_CALLED("_nc_free_tinfo()")));
 #if NO_LEAKS
+    if (cur_term != 0)
+       del_curterm(cur_term);
+
     _nc_free_tparm();
     _nc_tgetent_leaks();
     _nc_free_entries(_nc_head);
index bdcea3673301e83bc41f7b5d9a53e08814389d11..561a35b9274a5c0fcefc821e4d879846dbcf50c5 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2005,2006 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2006,2008 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 <dickey@clark.net> 1998
  *
- * $Id: filter.c,v 1.11 2006/12/09 16:53:47 tom Exp $
+ * $Id: filter.c,v 1.12 2008/12/06 21:59:27 tom Exp $
  */
 #include <test.priv.h>
 
@@ -78,16 +78,50 @@ new_command(char *buffer, int length, attr_t underline)
     return code;
 }
 
+static void
+usage(void)
+{
+    static const char *msg[] =
+    {
+       "Usage: filter [options]"
+       ,""
+       ,"Options:"
+       ,"  -i   use initscr() rather than newterm()"
+    };
+    unsigned n;
+    for (n = 0; n < SIZEOF(msg); n++)
+       fprintf(stderr, "%s\n", msg[n]);
+    ExitProgram(EXIT_FAILURE);
+}
+
 int
-main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
+main(int argc, char *argv[])
 {
+    int ch;
     char buffer[80];
     attr_t underline;
+    bool i_option = FALSE;
 
     setlocale(LC_ALL, "");
 
+    while ((ch = getopt(argc, argv, "i")) != -1) {
+       switch (ch) {
+       case 'i':
+           i_option = TRUE;
+           break;
+       default:
+           usage();
+       }
+    }
+
+    printf("starting filter program using %s...\n",
+          i_option ? "initscr" : "newterm");
     filter();
-    (void) newterm((char *) 0, stdout, stdin);
+    if (i_option) {
+       initscr();
+    } else {
+       (void) newterm((char *) 0, stdout, stdin);
+    }
     cbreak();
     keypad(stdscr, TRUE);