-- sale, use or other dealings in this Software without prior written --
-- authorization. --
-------------------------------------------------------------------------------
--- $Id: NEWS,v 1.2021 2013/02/09 22:39:26 tom Exp $
+-- $Id: NEWS,v 1.2023 2013/02/16 21:51:17 tom Exp $
-------------------------------------------------------------------------------
This is a log of changes that ncurses has gone through since Zeyd started
Changes through 1.9.9e did not credit all contributions;
it is not possible to add this information.
+20130216
+ + modify test/testcurs.c to work with mouse for ncurses as it does for
+ pdcurses.
+ + modify test/knight.c to work with mouse for pdcurses as it does for
+ ncurses.
+ + modify internal recursion in wgetch() which handles cooked mode to
+ check if the call to wgetnstr() returned an error. This can happen
+ when both nocbreak() and nodelay() are set, for instance (report by
+ Nils Christopher Brause) (cf: 960418).
+ + fixes for issues found by Coverity:
+ + add a check for valid position in ClearToEOS()
+ + fix in lib_twait.c when --enable-wgetch-events is used, pointer
+ use after free.
+ + improve a limit-check in make_hash.c
+ + fix a memory leak in hashed_db.c
+
20130209
+ modify test/configure script to make it simpler to override names
of curses-related libraries, to help with linking with pdcurses in
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
-# $Id: dist.mk,v 1.913 2013/02/09 17:27:48 tom Exp $
+# $Id: dist.mk,v 1.914 2013/02/16 16:48:32 tom Exp $
# Makefile for creating ncurses distributions.
#
# This only needs to be used directly as a makefile by developers, but
# These define the major/minor/patch versions of ncurses.
NCURSES_MAJOR = 5
NCURSES_MINOR = 9
-NCURSES_PATCH = 20130209
+NCURSES_PATCH = 20130216
# We don't append the patch to the version, since this only applies to releases
VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
/****************************************************************************
- * 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 *
#include <curses.priv.h>
-MODULE_ID("$Id: lib_getch.c,v 1.125 2012/08/04 17:11:37 tom Exp $")
+MODULE_ID("$Id: lib_getch.c,v 1.126 2013/02/16 18:30:37 tom Exp $")
#include <fifo_defs.h>
/* ungetch in reverse order */
#ifdef NCURSES_WGETCH_EVENTS
rc = recur_wgetnstr(win, buf);
- if (rc != KEY_EVENT)
+ if (rc != KEY_EVENT && rc != ERR)
safe_ungetch(sp, '\n');
#else
- (void) recur_wgetnstr(win, buf);
- safe_ungetch(sp, '\n');
+ if (recur_wgetnstr(win, buf) != ERR)
+ safe_ungetch(sp, '\n');
#endif
for (bufp = buf + strlen(buf); bufp > buf; bufp--)
safe_ungetch(sp, bufp[-1]);
/****************************************************************************
- * Copyright (c) 2006-2008,2011 Free Software Foundation, Inc. *
+ * Copyright (c) 2006-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 *
#if USE_HASHED_DB
-MODULE_ID("$Id: hashed_db.c,v 1.15 2011/08/13 21:08:08 tom Exp $")
+MODULE_ID("$Id: hashed_db.c,v 1.16 2013/02/16 21:50:03 tom Exp $")
#if HASHED_DB_API >= 2
static DBC *cursor;
if (p->path != 0) {
p->next = connections;
connections = p;
+ } else {
+ free(p);
}
}
}
#include <ctype.h>
-MODULE_ID("$Id: make_hash.c,v 1.11 2013/01/26 22:00:11 tom Exp $")
+MODULE_ID("$Id: make_hash.c,v 1.12 2013/02/16 21:27:50 tom Exp $")
/*
* _nc_make_hash_table()
int col = 0;
- if (list == 0 && (list = typeCalloc(char *, MAX_COLUMNS)) == 0)
+ if (list == 0 && (list = typeCalloc(char *, (MAX_COLUMNS + 1))) == 0)
return (0);
if (*buffer != '#') {
/****************************************************************************
- * 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 *
#endif
#undef CUR
-MODULE_ID("$Id: lib_twait.c,v 1.65 2012/10/27 20:42:47 tom Exp $")
+MODULE_ID("$Id: lib_twait.c,v 1.66 2013/02/16 20:52:07 tom Exp $")
static long
_nc_gettime(TimeType * t0, int first)
}
}
}
-
- if (fds != fd_list)
- free((char *) fds);
-
#endif
#elif defined(__BEOS__)
result |= TW_EVENT;
#endif
+#ifdef NCURSES_WGETCH_EVENTS
+ if (fds != fd_list)
+ free((char *) fds);
+#endif
+
return (result);
}
#include <ctype.h>
-MODULE_ID("$Id: tty_update.c,v 1.275 2013/01/20 00:34:46 tom Exp $")
+MODULE_ID("$Id: tty_update.c,v 1.276 2013/02/16 21:12:02 tom Exp $")
/*
* This define controls the line-breakout optimization. Every once in a
row = SP_PARM->_cursrow;
col = SP_PARM->_curscol;
+ if (row < 0)
+ row = 0;
+ if (col < 0)
+ col = 0;
+
UpdateAttrs(SP_PARM, blank);
TPUTS_TRACE("clr_eos");
NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx
-ncurses6 (5.9-20130209) unstable; urgency=low
+ncurses6 (5.9-20130216) unstable; urgency=low
* latest weekly patch
- -- Thomas E. Dickey <dickey@invisible-island.net> Sat, 09 Feb 2013 12:28:44 -0500
+ -- Thomas E. Dickey <dickey@invisible-island.net> Sat, 16 Feb 2013 11:48:20 -0500
ncurses6 (5.9-20120608) unstable; urgency=low
Summary: shared libraries for terminal handling
Name: ncurses6
Release: 5.9
-Version: 20130209
+Version: 20130216
License: X11
Group: Development/Libraries
Source: ncurses-%{release}-%{version}.tgz
/****************************************************************************
- * 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 *
* v2.0 featuring strict ANSI/POSIX conformance, November 1993.
* v2.1 with ncurses mouse support, September 1995
*
- * $Id: bs.c,v 1.59 2012/12/16 00:20:49 tom Exp $
+ * $Id: bs.c,v 1.60 2013/02/16 19:54:37 tom Exp $
*/
#include <test.priv.h>
bool hit, sunk;
ship_t *ss = NULL;
- hit = board[PLAYER][x][y];
+ hit = (bool) board[PLAYER][x][y];
hits[COMPUTER][x][y] = (hit ? MARK_HIT : MARK_MISS);
MvPrintw(PROMPTLINE, 0,
"I shoot at %c%d. I %s!", y + 'A', x, hit ? "hit" :
* Eric S. Raymond <esr@snark.thyrsus.com> July 22 1995. Mouse support
* added September 20th 1995.
*
- * $Id: knight.c,v 1.35 2013/02/03 00:16:59 tom Exp $
+ * $Id: knight.c,v 1.36 2013/02/16 19:53:08 tom Exp $
*/
#include <test.priv.h>
#ifdef NCURSES_MOUSE_VERSION
(void) mousemask(BUTTON1_CLICKED, (mmask_t *) NULL);
#endif /* NCURSES_MOUSE_VERSION */
+#if defined(PDCURSES)
+ mouse_set(BUTTON1_RELEASED);
+#endif
oldch = minus;
}
nx = col + 1;
break;
-#ifdef NCURSES_MOUSE_VERSION
+#ifdef KEY_MOUSE
case KEY_MOUSE:
+#ifdef NCURSES_MOUSE_VERSION
{
MEVENT myevent;
}
}
#endif /* NCURSES_MOUSE_VERSION */
+#ifdef PDCURSES
+ {
+ int test_y, test_x;
+ request_mouse_pos();
+ test_y = MOUSE_Y_POS + 0;
+ test_x = MOUSE_X_POS + 1;
+ if (test_y >= CY(0) && test_y <= CY(BDEPTH)
+ && test_x >= CX(0) && test_x <= CX(BWIDTH)) {
+ ny = CYINV(test_y);
+ nx = CXINV(test_x);
+ wmove(helpwin, 0, 0);
+ wrefresh(helpwin);
+ ungetch('\n');
+ }
+ break;
+ }
+#endif /* PDCURSES */
+#endif /* KEY_MOUSE */
case KEY_B2:
case '\n':
Author: Eric S. Raymond <esr@snark.thyrsus.com> 1993
Thomas E. Dickey (beginning revision 1.27 in 1996).
-$Id: ncurses.c,v 1.387 2013/01/13 00:40:17 tom Exp $
+$Id: ncurses.c,v 1.388 2013/02/16 18:56:30 tom Exp $
***************************************************************************/
bkgdset(BLANK);
/* tests, in general, will want these modes */
- use_colors = monochrome ? FALSE : has_colors();
+ use_colors = (bool) (monochrome ? FALSE : has_colors());
if (use_colors) {
start_color();
* wrs(5/28/93) -- modified to be consistent (perform identically) with either
* PDCurses or under Unix System V, R4
*
- * $Id: testcurs.c,v 1.46 2012/11/24 19:38:20 tom Exp $
+ * $Id: testcurs.c,v 1.47 2013/02/16 20:29:04 tom Exp $
*/
#include <test.priv.h>
typeahead(-1);
#endif
+#ifdef NCURSES_MOUSE_VERSION
+ mousemask(ALL_MOUSE_EVENTS, (mmask_t *) 0);
+#endif
#if defined(PDCURSES)
mouse_set(ALL_MOUSE_EVENTS);
#endif
wprintw(win, "Key Pressed: %c", c);
else
wprintw(win, "Key Pressed: %s", unctrl(UChar(c)));
-#if defined(PDCURSES)
+#ifdef KEY_MOUSE
+#define ButtonChanged(n) ((event.bstate) & NCURSES_MOUSE_MASK(1, 037))
+#define ButtonPressed(n) ((event.bstate) & NCURSES_MOUSE_MASK(1, NCURSES_BUTTON_PRESSED))
+#define ButtonDouble(n) ((event.bstate) & NCURSES_MOUSE_MASK(1, NCURSES_DOUBLE_CLICKED))
+#define ButtonTriple(n) ((event.bstate) & NCURSES_MOUSE_MASK(1, NCURSES_TRIPLE_CLICKED))
+#define ButtonRelease(n) ((event.bstate) & NCURSES_MOUSE_MASK(1, NCURSES_BUTTON_RELEASED))
if (c == KEY_MOUSE) {
+ MEVENT event;
+ int button = 0;
+
+ getmouse(&event);
+ if (ButtonChanged(1))
+ button = 1;
+ else if (ButtonChanged(2))
+ button = 2;
+ else if (ButtonChanged(3))
+ button = 3;
+ else
+ button = 0;
+ wmove(win, 4, 18);
+ wprintw(win, "Button %d: ", button);
+ if (ButtonPressed(button))
+ wprintw(win, "pressed: ");
+ else if (ButtonDouble(button))
+ wprintw(win, "double: ");
+ else if (ButtonTriple(button))
+ wprintw(win, "triple: ");
+ else
+ wprintw(win, "released: ");
+ wprintw(win, " Position: Y: %d X: %d", event.y, event.x);
+#if defined(NCURSES_MOUSE_VERSION)
+#elif defined(PDCURSES)
int button = 0;
request_mouse_pos();
if (BUTTON_CHANGED(1))
else
wprintw(win, "released: ");
wprintw(win, " Position: Y: %d X: %d", MOUSE_Y_POS, MOUSE_X_POS);
+#endif /* PDCURSES */
}
-#endif
+#endif /* KEY_MOUSE */
wrefresh(win);
if (c == ' ')
break;