]> ncurses.scripts.mit.edu Git - ncurses.git/commitdiff
ncurses 5.7 - patch 20090530
authorThomas E. Dickey <dickey@invisible-island.net>
Sat, 30 May 2009 23:24:28 +0000 (23:24 +0000)
committerThomas E. Dickey <dickey@invisible-island.net>
Sat, 30 May 2009 23:24:28 +0000 (23:24 +0000)
+ fix an infinite recursion when adding a legacy-coding 8-bit value
  using insch() (report by Clemens Ladisch).
+ free home-terminfo string in del_curterm() (patch by Dan Weber).
+ continue integrating "sp-funcs" by Juergen Pfeifer (incomplete).

12 files changed:
NEWS
dist.mk
ncurses/base/lib_dft_fgbg.c
ncurses/base/lib_getch.c
ncurses/base/lib_insch.c
ncurses/base/lib_insnstr.c
ncurses/curses.priv.h
ncurses/tinfo/lib_cur_term.c
ncurses/tinfo/lib_data.c
ncurses/tinfo/lib_setup.c
ncurses/widechar/lib_ins_wch.c
test/demo_forms.c

diff --git a/NEWS b/NEWS
index 98b5d4d26e273ceb76d603b8c752b25d17fbc734..4da6e362465a7340655bdcad0fa6e2bd9d1b9628 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -25,7 +25,7 @@
 -- sale, use or other dealings in this Software without prior written        --
 -- authorization.                                                            --
 -------------------------------------------------------------------------------
 -- sale, use or other dealings in this Software without prior written        --
 -- authorization.                                                            --
 -------------------------------------------------------------------------------
--- $Id: NEWS,v 1.1389 2009/05/23 22:48:27 tom Exp $
+-- $Id: NEWS,v 1.1392 2009/05/30 19:19:59 tom Exp $
 -------------------------------------------------------------------------------
 
 This is a log of changes that ncurses has gone through since Zeyd started
 -------------------------------------------------------------------------------
 
 This is a log of changes that ncurses has gone through since Zeyd started
@@ -45,6 +45,12 @@ 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.
 
 Changes through 1.9.9e did not credit all contributions;
 it is not possible to add this information.
 
+20090530
+       + fix an infinite recursion when adding a legacy-coding 8-bit value
+         using insch() (report by Clemens Ladisch).
+       + free home-terminfo string in del_curterm() (patch by Dan Weber).
+       + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete).
+
 20090523
        + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete).
 
 20090523
        + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete).
 
diff --git a/dist.mk b/dist.mk
index f52e386da4ef137bd800b5c67e89770334de68ad..22884a3d2c8f531ace2f9c2bb208826f60fc543c 100644 (file)
--- a/dist.mk
+++ b/dist.mk
@@ -25,7 +25,7 @@
 # use or other dealings in this Software without prior written               #
 # authorization.                                                             #
 ##############################################################################
 # use or other dealings in this Software without prior written               #
 # authorization.                                                             #
 ##############################################################################
-# $Id: dist.mk,v 1.701 2009/05/23 18:08:28 tom Exp $
+# $Id: dist.mk,v 1.702 2009/05/30 13:36:52 tom Exp $
 # Makefile for creating ncurses distributions.
 #
 # This only needs to be used directly as a makefile by developers, but
 # 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
 # These define the major/minor/patch versions of ncurses.
 NCURSES_MAJOR = 5
 NCURSES_MINOR = 7
-NCURSES_PATCH = 20090523
+NCURSES_PATCH = 20090530
 
 # We don't append the patch to the version, since this only applies to releases
 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
 
 # We don't append the patch to the version, since this only applies to releases
 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
index eda197619189a98222d6c81b539cdf5e6bd8d338..b72c0b9422f2bfbdde62a39a91869fde5ab432bb 100644 (file)
@@ -37,7 +37,7 @@
 #define CUR SP_TERMTYPE
 #endif
 
 #define CUR SP_TERMTYPE
 #endif
 
-MODULE_ID("$Id: lib_dft_fgbg.c,v 1.23 2009/05/23 23:04:15 tom Exp $")
+MODULE_ID("$Id: lib_dft_fgbg.c,v 1.24 2009/05/30 20:00:00 tom Exp $")
 
 /*
  * Modify the behavior of color-pair 0 so that the library doesn't assume that
 
 /*
  * Modify the behavior of color-pair 0 so that the library doesn't assume that
@@ -69,8 +69,8 @@ NCURSES_SP_NAME(assume_default_colors) (NCURSES_SP_DCLx int fg, int bg)
 
     T((T_CALLED("assume_default_colors(%p,%d,%d)"), SP_PARM, fg, bg));
 #ifdef USE_TERM_DRIVER
 
     T((T_CALLED("assume_default_colors(%p,%d,%d)"), SP_PARM, fg, bg));
 #ifdef USE_TERM_DRIVER
-    if (SP_PARM != 0)
-       code = CallDriver_2(SP_PARM, defaultcolors, fg, bg);
+    if (sp != 0)
+       code = CallDriver_2(sp, defaultcolors, fg, bg);
 #else
     if ((orig_pair || orig_colors) && !initialize_pair) {
 
 #else
     if ((orig_pair || orig_colors) && !initialize_pair) {
 
index 63e64fa44496375cfd78c48b814261f2b760060a..e228355a019ea38a9bd1aaac92a471a0698ff4f9 100644 (file)
 
 #include <curses.priv.h>
 
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_getch.c,v 1.102 2009/04/18 20:32:33 tom Exp $")
+MODULE_ID("$Id: lib_getch.c,v 1.103 2009/05/30 15:50:47 tom Exp $")
 
 #include <fifo_defs.h>
 
 #if USE_REENTRANT
 #define GetEscdelay(sp) (sp)->_ESCDELAY
 
 #include <fifo_defs.h>
 
 #if USE_REENTRANT
 #define GetEscdelay(sp) (sp)->_ESCDELAY
+NCURSES_EXPORT(int *)
+_nc_ptr_Escdelay(SCREEN *sp)
+{
+    return ptrEscdelay(sp);
+}
 NCURSES_EXPORT(int)
 NCURSES_PUBLIC_VAR(ESCDELAY) (void)
 {
 NCURSES_EXPORT(int)
 NCURSES_PUBLIC_VAR(ESCDELAY) (void)
 {
-    return SP ? GetEscdelay(SP) : 1000;
+    return *_nc_ptr_Escdelay(CURRENT_SCREEN);
 }
 #else
 #define GetEscdelay(sp) ESCDELAY
 }
 #else
 #define GetEscdelay(sp) ESCDELAY
index d813740e43c5f92bbb578d35a41fe6c10760973d..e88b945a741fe178d946694093173bfac4c7daee 100644 (file)
 #include <curses.priv.h>
 #include <ctype.h>
 
 #include <curses.priv.h>
 #include <ctype.h>
 
-MODULE_ID("$Id: lib_insch.c,v 1.27 2009/04/18 23:53:33 tom Exp $")
+MODULE_ID("$Id: lib_insch.c,v 1.29 2009/05/30 16:45:16 tom Exp $")
 
 /*
  * Insert the given character, updating the current location to simplify
  * inserting a string.
  */
 NCURSES_EXPORT(int)
 
 /*
  * Insert the given character, updating the current location to simplify
  * inserting a string.
  */
 NCURSES_EXPORT(int)
-_nc_insert_ch(WINDOW *win, chtype ch)
+_nc_insert_ch(SCREEN *sp, WINDOW *win, chtype ch)
 {
     int code = OK;
     NCURSES_CH_T wch;
     int count;
     NCURSES_CONST char *s;
 {
     int code = OK;
     NCURSES_CH_T wch;
     int count;
     NCURSES_CONST char *s;
-#if NCURSES_SP_FUNCS || USE_REENTRANT
-    SCREEN *sp = _nc_screen_of(win);
-#endif
     int tabsize =
 #if USE_REENTRANT
     sp->_TABSIZE
     int tabsize =
 #if USE_REENTRANT
     sp->_TABSIZE
@@ -66,10 +63,11 @@ _nc_insert_ch(WINDOW *win, chtype ch)
     TABSIZE
 #endif
      ;
     TABSIZE
 #endif
      ;
+
     switch (ch) {
     case '\t':
        for (count = (tabsize - (win->_curx % tabsize)); count > 0; count--) {
     switch (ch) {
     case '\t':
        for (count = (tabsize - (win->_curx % tabsize)); count > 0; count--) {
-           if ((code = _nc_insert_ch(win, ' ')) != OK)
+           if ((code = _nc_insert_ch(sp, win, ' ')) != OK)
                break;
        }
        break;
                break;
        }
        break;
@@ -85,7 +83,9 @@ _nc_insert_ch(WINDOW *win, chtype ch)
               WINDOW_EXT(win, addch_used) == 0 &&
 #endif
               is8bits(ChCharOf(ch)) &&
               WINDOW_EXT(win, addch_used) == 0 &&
 #endif
               is8bits(ChCharOf(ch)) &&
-              isprint(ChCharOf(ch))) {
+              (isprint(ChCharOf(ch)) ||
+               (ChAttrOf(ch) & A_ALTCHARSET) ||
+               (sp != 0 && sp->_legacy_coding && !iscntrl(ChCharOf(ch))))) {
            if (win->_curx <= win->_maxx) {
                struct ldat *line = &(win->_line[win->_cury]);
                NCURSES_CH_T *end = &(line->text[win->_curx]);
            if (win->_curx <= win->_maxx) {
                struct ldat *line = &(win->_line[win->_cury]);
                NCURSES_CH_T *end = &(line->text[win->_curx]);
@@ -104,7 +104,7 @@ _nc_insert_ch(WINDOW *win, chtype ch)
        } else if (is8bits(ChCharOf(ch)) && iscntrl(ChCharOf(ch))) {
            s = NCURSES_SP_NAME(unctrl) (NCURSES_SP_ARGx ChCharOf(ch));
            while (*s != '\0') {
        } else if (is8bits(ChCharOf(ch)) && iscntrl(ChCharOf(ch))) {
            s = NCURSES_SP_NAME(unctrl) (NCURSES_SP_ARGx ChCharOf(ch));
            while (*s != '\0') {
-               code = _nc_insert_ch(win, ChAttrOf(ch) | UChar(*s));
+               code = _nc_insert_ch(sp, win, ChAttrOf(ch) | UChar(*s));
                if (code != OK)
                    break;
                ++s;
                if (code != OK)
                    break;
                ++s;
@@ -124,11 +124,16 @@ _nc_insert_ch(WINDOW *win, chtype ch)
                /* handle EILSEQ */
                if (is8bits(ch)) {
                    s = NCURSES_SP_NAME(unctrl) (NCURSES_SP_ARGx ChCharOf(ch));
                /* handle EILSEQ */
                if (is8bits(ch)) {
                    s = NCURSES_SP_NAME(unctrl) (NCURSES_SP_ARGx ChCharOf(ch));
-                   while (*s != '\0') {
-                       code = _nc_insert_ch(win, ChAttrOf(ch) | UChar(*s));
-                       if (code != OK)
-                           break;
-                       ++s;
+                   if (strlen(s) > 1) {
+                       while (*s != '\0') {
+                           code = _nc_insert_ch(sp, win,
+                                                ChAttrOf(ch) | UChar(*s));
+                           if (code != OK)
+                               break;
+                           ++s;
+                       }
+                   } else {
+                       code = ERR;
                    }
                } else {
                    code = ERR;
                    }
                } else {
                    code = ERR;
@@ -154,7 +159,7 @@ winsch(WINDOW *win, chtype c)
        oy = win->_cury;
        ox = win->_curx;
 
        oy = win->_cury;
        ox = win->_curx;
 
-       code = _nc_insert_ch(win, c);
+       code = _nc_insert_ch(_nc_screen_of(win), win, c);
 
        win->_curx = ox;
        win->_cury = oy;
 
        win->_curx = ox;
        win->_cury = oy;
index b6ddfde3c52b57117fce0aef7a8a180f40695c59..16d945952b37fa1927dbf695b6d69ddd76d54731 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
 /****************************************************************************
- * Copyright (c) 2004 Free Software Foundation, Inc.                        *
+ * Copyright (c) 2004,2009 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            *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -40,7 +40,7 @@
 #include <curses.priv.h>
 #include <ctype.h>
 
 #include <curses.priv.h>
 #include <ctype.h>
 
-MODULE_ID("$Id: lib_insnstr.c,v 1.1 2004/02/28 23:44:56 tom Exp $")
+MODULE_ID("$Id: lib_insnstr.c,v 1.2 2009/05/30 14:53:49 tom Exp $")
 
 NCURSES_EXPORT(int)
 winsnstr(WINDOW *win, const char *s, int n)
 
 NCURSES_EXPORT(int)
 winsnstr(WINDOW *win, const char *s, int n)
@@ -54,10 +54,12 @@ winsnstr(WINDOW *win, const char *s, int n)
     T((T_CALLED("winsnstr(%p,%s,%d)"), win, _nc_visbufn(s, n), n));
 
     if (win != 0 && str != 0) {
     T((T_CALLED("winsnstr(%p,%s,%d)"), win, _nc_visbufn(s, n), n));
 
     if (win != 0 && str != 0) {
+       SCREEN *sp = _nc_screen_of(win);
+
        oy = win->_cury;
        ox = win->_curx;
        for (cp = str; *cp && (n <= 0 || (cp - str) < n); cp++) {
        oy = win->_cury;
        ox = win->_curx;
        for (cp = str; *cp && (n <= 0 || (cp - str) < n); cp++) {
-           _nc_insert_ch(win, (chtype) UChar(*cp));
+           _nc_insert_ch(sp, win, (chtype) UChar(*cp));
        }
        win->_curx = ox;
        win->_cury = oy;
        }
        win->_curx = ox;
        win->_cury = oy;
index f6d4c47b840062b51c0d4dc75439d6bb0b96ef44..71277786fb2e8be28c305c46152f8a840fb99a34 100644 (file)
@@ -35,7 +35,7 @@
 
 
 /*
 
 
 /*
- * $Id: curses.priv.h,v 1.417 2009/05/23 23:01:44 tom Exp $
+ * $Id: curses.priv.h,v 1.420 2009/05/30 15:53:46 tom Exp $
  *
  *     curses.priv.h
  *
  *
  *     curses.priv.h
  *
@@ -374,17 +374,31 @@ extern NCURSES_EXPORT(void)     _nc_set_no_padding(SCREEN *);
 #define SET_SCREEN_PAIR(s,p)   SetPair(SCREEN_ATTRS(s), p)
 
 #if USE_REENTRANT
 #define SET_SCREEN_PAIR(s,p)   SetPair(SCREEN_ATTRS(s), p)
 
 #if USE_REENTRANT
-NCURSES_EXPORT(int *)        _nc_ptr_Lines (void);
-NCURSES_EXPORT(int *)        _nc_ptr_Cols (void);
+
+NCURSES_EXPORT(int *)        _nc_ptr_Lines (SCREEN *);
+NCURSES_EXPORT(int *)        _nc_ptr_Cols (SCREEN *);
+NCURSES_EXPORT(int *)        _nc_ptr_Tabsize (SCREEN *);
+NCURSES_EXPORT(int *)        _nc_ptr_Escdelay (SCREEN *);
+
 #define ptrLines(sp)         (sp ? &(sp->_LINES) : &(_nc_prescreen._LINES))
 #define ptrCols(sp)          (sp ? &(sp->_COLS) : &(_nc_prescreen._COLS))
 #define ptrLines(sp)         (sp ? &(sp->_LINES) : &(_nc_prescreen._LINES))
 #define ptrCols(sp)          (sp ? &(sp->_COLS) : &(_nc_prescreen._COLS))
-#define SET_LINES(value)     *_nc_ptr_Lines() = value
-#define SET_COLS(value)      *_nc_ptr_Cols() = value
+#define ptrTabsize(sp)       (sp ? &(sp->_TABSIZE) : &(_nc_prescreen._TABSIZE))
+#define ptrEscdelay(sp)      (sp ? &(sp->_ESCDELAY) : &(_nc_prescreen._ESCDELAY))
+
+#define SET_LINES(value)     *_nc_ptr_Lines(SP_PARM) = value
+#define SET_COLS(value)      *_nc_ptr_Cols(SP_PARM) = value
+#define SET_TABSIZE(value)   *_nc_ptr_Tabsize(SP_PARM) = value
+#define SET_ESCDELAY(value)  *_nc_ptr_Escdelay(SP_PARM) = value
+
 #else
 #else
+
 #define ptrLines(sp)         &LINES
 #define ptrCols(sp)          &COLS
 #define SET_LINES(value)     LINES = value
 #define SET_COLS(value)      COLS = value
 #define ptrLines(sp)         &LINES
 #define ptrCols(sp)          &COLS
 #define SET_LINES(value)     LINES = value
 #define SET_COLS(value)      COLS = value
+#define SET_TABSIZE(value)   TABSIZE = value
+#define SET_ESCDELAY(value)  ESCDELAY = value
+
 #endif
 
 #define TR_MUTEX(data) _tracef("%s@%d: me:%08lX COUNT:%2u/%2d/%6d/%2d/%s%9u: " #data, \
 #endif
 
 #define TR_MUTEX(data) _tracef("%s@%d: me:%08lX COUNT:%2u/%2d/%6d/%2d/%s%9u: " #data, \
@@ -760,6 +774,8 @@ typedef struct {
        chtype          *real_acs_map;
        int             _LINES;
        int             _COLS;
        chtype          *real_acs_map;
        int             _LINES;
        int             _COLS;
+       int             _TABSIZE;
+       int             _ESCDELAY;
        TERMINAL        *_cur_term;
 #ifdef TRACE
        long            _outchars;
        TERMINAL        *_cur_term;
 #ifdef TRACE
        long            _outchars;
@@ -1622,7 +1638,7 @@ extern NCURSES_EXPORT(bool) _nc_reset_colors(void);
 extern NCURSES_EXPORT(int) _nc_wgetch(WINDOW *, unsigned long *, int EVENTLIST_2nd(_nc_eventlist *));
 
 /* lib_insch.c */
 extern NCURSES_EXPORT(int) _nc_wgetch(WINDOW *, unsigned long *, int EVENTLIST_2nd(_nc_eventlist *));
 
 /* lib_insch.c */
-extern NCURSES_EXPORT(int) _nc_insert_ch(WINDOW *, chtype);
+extern NCURSES_EXPORT(int) _nc_insert_ch(SCREEN *, WINDOW *, chtype);
 
 /* lib_mvcur.c */
 #define INFINITY       1000000 /* cost: too high to use */
 
 /* lib_mvcur.c */
 #define INFINITY       1000000 /* cost: too high to use */
@@ -1651,6 +1667,9 @@ extern NCURSES_EXPORT(int)    _nc_locale_breaks_acs(TERMINAL *);
 extern NCURSES_EXPORT(int)    _nc_setupterm(NCURSES_CONST char *, int, int *, bool);
 extern NCURSES_EXPORT(void)   _nc_get_screensize(SCREEN *, int *, int *);
 
 extern NCURSES_EXPORT(int)    _nc_setupterm(NCURSES_CONST char *, int, int *, bool);
 extern NCURSES_EXPORT(void)   _nc_get_screensize(SCREEN *, int *, int *);
 
+/* lib_set_term.c */
+extern NCURSES_EXPORT(int)    _nc_ripoffline(int, int(*)(WINDOW*, int));
+
 /* lib_tstp.c */
 #if USE_SIGWINCH
 extern NCURSES_EXPORT(int) _nc_handle_sigwinch(SCREEN *);
 /* lib_tstp.c */
 #if USE_SIGWINCH
 extern NCURSES_EXPORT(int) _nc_handle_sigwinch(SCREEN *);
@@ -1832,8 +1851,6 @@ extern NCURSES_EXPORT(int) _nc_format_slks (SCREEN *, int);
 #define MAX_SKEY(fmt)     (SLK_STDFMT(fmt)? MAX_SKEY_OLD : MAX_SKEY_PC)
 #define MAX_SKEY_LEN(fmt) (SLK_STDFMT(fmt)? MAX_SKEY_LEN_OLD : MAX_SKEY_LEN_PC)
 
 #define MAX_SKEY(fmt)     (SLK_STDFMT(fmt)? MAX_SKEY_OLD : MAX_SKEY_PC)
 #define MAX_SKEY_LEN(fmt) (SLK_STDFMT(fmt)? MAX_SKEY_LEN_OLD : MAX_SKEY_LEN_PC)
 
-extern NCURSES_EXPORT(int) _nc_ripoffline (int line, int (*init)(WINDOW *,int));
-
 /*
  * Common error messages
  */
 /*
  * Common error messages
  */
index 5dc53fca9b001fc87ec2b0fe5ecc9b20eec71c35..26e8dc8d4d971fea7465e1583c1a6bed913cb2a4 100644 (file)
@@ -40,7 +40,7 @@
 #include <term_entry.h>                /* TTY, cur_term */
 #include <termcap.h>           /* ospeed */
 
 #include <term_entry.h>                /* TTY, cur_term */
 #include <termcap.h>           /* ospeed */
 
-MODULE_ID("$Id: lib_cur_term.c,v 1.21 2009/04/18 21:02:22 tom Exp $")
+MODULE_ID("$Id: lib_cur_term.c,v 1.22 2009/05/30 13:55:19 tom Exp $")
 
 #undef CUR
 #define CUR termp->type.
 
 #undef CUR
 #define CUR termp->type.
@@ -98,6 +98,10 @@ NCURSES_SP_NAME(del_curterm) (NCURSES_SP_DCLx TERMINAL * termp)
     if (termp != 0) {
        _nc_free_termtype(&(termp->type));
        FreeIfNeeded(termp->_termname);
     if (termp != 0) {
        _nc_free_termtype(&(termp->type));
        FreeIfNeeded(termp->_termname);
+#if USE_HOME_TERMINFO
+       if (_nc_globals.home_terminfo != 0)
+           FreeAndNull(_nc_globals.home_terminfo);
+#endif
        free(termp);
        if (termp == cur_term)
            set_curterm(0);
        free(termp);
        if (termp == cur_term)
            set_curterm(0);
index e84209d4022cfe7ff3f70da51775b394dcfc5443..1f912d9a8736c8a2f20ded7dc791c7b3e67592ac 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2008,2009 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            *
  *                                                                          *
  * 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 <curses.priv.h>
 
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_data.c,v 1.52 2008/08/23 22:16:15 tom Exp $")
+MODULE_ID("$Id: lib_data.c,v 1.53 2009/05/30 15:59:25 tom Exp $")
 
 /*
  * OS/2's native linker complains if we don't initialize public data when
 
 /*
  * OS/2's native linker complains if we don't initialize public data when
@@ -225,6 +225,8 @@ NCURSES_EXPORT_VAR(NCURSES_PRESCREEN) _nc_prescreen = {
     NULL,                      /* real_acs_map */
     0,                         /* LINES */
     0,                         /* COLS */
     NULL,                      /* real_acs_map */
     0,                         /* LINES */
     0,                         /* COLS */
+    8,                         /* TABSIZE */
+    1000,                      /* ESCDELAY */
     0,                         /* cur_term */
 #ifdef TRACE
     0L,                                /* _outchars */
     0,                         /* cur_term */
 #ifdef TRACE
     0L,                                /* _outchars */
index 9968083c9ff10cb91448ff480696ced5d4318a63..b01df6a2fa58adf3da8ee93915da72ebb6b8cc68 100644 (file)
@@ -54,7 +54,7 @@
 
 #include <term.h>              /* lines, columns, cur_term */
 
 
 #include <term.h>              /* lines, columns, cur_term */
 
-MODULE_ID("$Id: lib_setup.c,v 1.114 2009/04/18 23:52:03 tom Exp $")
+MODULE_ID("$Id: lib_setup.c,v 1.116 2009/05/30 20:39:21 tom Exp $")
 
 /****************************************************************************
  *
 
 /****************************************************************************
  *
@@ -117,35 +117,40 @@ NCURSES_PUBLIC_VAR(ttytype) (void)
     return cur_term ? cur_term->type.term_names : empty;
 }
 NCURSES_EXPORT(int *)
     return cur_term ? cur_term->type.term_names : empty;
 }
 NCURSES_EXPORT(int *)
-_nc_ptr_Lines(void)
+_nc_ptr_Lines(SCREEN *sp)
 {
 {
-    return ptrLines(CURRENT_SCREEN);
+    return ptrLines(sp);
 }
 NCURSES_EXPORT(int)
 NCURSES_PUBLIC_VAR(LINES) (void)
 {
 }
 NCURSES_EXPORT(int)
 NCURSES_PUBLIC_VAR(LINES) (void)
 {
-    return *_nc_ptr_Lines();
+    return *_nc_ptr_Lines(CURRENT_SCREEN);
 }
 NCURSES_EXPORT(int *)
 }
 NCURSES_EXPORT(int *)
-_nc_ptr_Cols(void)
+_nc_ptr_Cols(SCREEN *sp)
 {
 {
-    return ptrCols(CURRENT_SCREEN);
+    return ptrCols(sp);
 }
 NCURSES_EXPORT(int)
 NCURSES_PUBLIC_VAR(COLS) (void)
 {
 }
 NCURSES_EXPORT(int)
 NCURSES_PUBLIC_VAR(COLS) (void)
 {
-    return *_nc_ptr_Cols();
+    return *_nc_ptr_Cols(CURRENT_SCREEN);
+}
+NCURSES_EXPORT(int *)
+_nc_ptr_Tabsize(SCREEN *sp)
+{
+    return ptrTabsize(sp);
 }
 NCURSES_EXPORT(int)
 NCURSES_PUBLIC_VAR(TABSIZE) (void)
 {
 }
 NCURSES_EXPORT(int)
 NCURSES_PUBLIC_VAR(TABSIZE) (void)
 {
-    return SP ? SP->_TABSIZE : 8;
+    return *_nc_ptr_Tabsize(CURRENT_SCREEN);
 }
 #else
 NCURSES_EXPORT_VAR(char) ttytype[NAMESIZE] = "";
 NCURSES_EXPORT_VAR(int) LINES = 0;
 NCURSES_EXPORT_VAR(int) COLS = 0;
 }
 #else
 NCURSES_EXPORT_VAR(char) ttytype[NAMESIZE] = "";
 NCURSES_EXPORT_VAR(int) LINES = 0;
 NCURSES_EXPORT_VAR(int) COLS = 0;
-NCURSES_EXPORT_VAR(int) TABSIZE = 0;
+NCURSES_EXPORT_VAR(int) TABSIZE = 8;
 #endif
 
 #if NCURSES_EXT_FUNCS
 #endif
 
 #if NCURSES_EXT_FUNCS
index c3d0420e53b898312ca6f46e5bf10537cfc44925..ef9e1b0a3fd2ef51ee720d91a70337ed79057405 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
 /****************************************************************************
- * Copyright (c) 2002-2003,2005 Free Software Foundation, Inc.              *
+ * Copyright (c) 2002-2005,2009 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            *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -39,7 +39,7 @@
 
 #include <curses.priv.h>
 
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_ins_wch.c,v 1.8 2005/12/03 20:24:19 tom Exp $")
+MODULE_ID("$Id: lib_ins_wch.c,v 1.9 2009/05/30 14:52:42 tom Exp $")
 
 /*
  * Insert the given character, updating the current location to simplify
 
 /*
  * Insert the given character, updating the current location to simplify
@@ -112,6 +112,8 @@ wins_nwstr(WINDOW *win, const wchar_t *wstr, int n)
            n = wcslen(wstr);
        code = OK;
        if (n > 0) {
            n = wcslen(wstr);
        code = OK;
        if (n > 0) {
+           SCREEN *sp = _nc_screen_of(win);
+
            oy = win->_cury;
            ox = win->_curx;
            for (cp = wstr; *cp && ((cp - wstr) < n); cp++) {
            oy = win->_cury;
            ox = win->_curx;
            for (cp = wstr; *cp && ((cp - wstr) < n); cp++) {
@@ -129,7 +131,7 @@ wins_nwstr(WINDOW *win, const wchar_t *wstr, int n)
                    code = _nc_insert_wch(win, &tmp_cchar);
                } else {
                    /* tabs, other ASCII stuff */
                    code = _nc_insert_wch(win, &tmp_cchar);
                } else {
                    /* tabs, other ASCII stuff */
-                   code = _nc_insert_ch(win, (chtype) (*cp));
+                   code = _nc_insert_ch(sp, win, (chtype) (*cp));
                }
                if (code != OK)
                    break;
                }
                if (code != OK)
                    break;
index 5940e796a305674c2af0b5c4b2a0df1f6d10d674..cbfc64b4db9613fad2eaf927e5a4e653bbb67cf7 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
 /****************************************************************************
- * Copyright (c) 2003-2007,2008 Free Software Foundation, Inc.              *
+ * Copyright (c) 2003-2008,2009 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            *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -26,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: demo_forms.c,v 1.31 2008/12/20 19:23:00 tom Exp $
+ * $Id: demo_forms.c,v 1.32 2009/05/30 16:52:42 tom Exp $
  *
  * Demonstrate a variety of functions from the form library.
  * Thomas Dickey - 2003/4/26
  *
  * Demonstrate a variety of functions from the form library.
  * Thomas Dickey - 2003/4/26
@@ -451,8 +451,11 @@ demo_forms(void)
 
        free_form(form);
     }
 
        free_form(form);
     }
-    for (c = 0; f[c] != 0; c++)
+    for (c = 0; f[c] != 0; c++) {
+       void *ptr = field_userptr(f[c]);
+       free(ptr);
        free_field(f[c]);
        free_field(f[c]);
+    }
     noraw();
     nl();
 
     noraw();
     nl();