CVS commit: [netbsd-7] src/lib/libcurses
Module Name:src Committed By: martin Date: Fri Mar 15 14:36:22 UTC 2019 Modified Files: src/lib/libcurses [netbsd-7]: get_wch.c getch.c Log Message: Pull up following revision(s) (requested by rin in ticket #1686): lib/libcurses/get_wch.c: revision 1.21 lib/libcurses/getch.c: revision 1.71 Rename global variable "state" to "_cursesi_state". Until now, if application happens to have a global variable of the same name, it was overridden by curses routines. This is the scenario in which aspell crashes when linked to our curses, reported in pkg/44005. We need to wipe out global/static variables like "_cursesi_state" or "wstate" for thread safety. But it would be a future task... XXX pullup to netbsd-8 and netbsd-7 To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.10.10.1 src/lib/libcurses/get_wch.c cvs rdiff -u -r1.59 -r1.59.10.1 src/lib/libcurses/getch.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libcurses/get_wch.c diff -u src/lib/libcurses/get_wch.c:1.10 src/lib/libcurses/get_wch.c:1.10.10.1 --- src/lib/libcurses/get_wch.c:1.10 Fri Jun 29 10:40:29 2012 +++ src/lib/libcurses/get_wch.c Fri Mar 15 14:36:22 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: get_wch.c,v 1.10 2012/06/29 10:40:29 blymn Exp $ */ +/* $NetBSD: get_wch.c,v 1.10.10.1 2019/03/15 14:36:22 martin Exp $ */ /* * Copyright (c) 2005 The NetBSD Foundation Inc. @@ -36,7 +36,7 @@ #include #ifndef lint -__RCSID("$NetBSD: get_wch.c,v 1.10 2012/06/29 10:40:29 blymn Exp $"); +__RCSID("$NetBSD: get_wch.c,v 1.10.10.1 2019/03/15 14:36:22 martin Exp $"); #endif /* not lint */ #include @@ -48,9 +48,9 @@ __RCSID("$NetBSD: get_wch.c,v 1.10 2012/ #include "keymap.h" #ifdef HAVE_WCHAR -static short wstate; /* state of the wcinkey function */ +static short wstate; /* state of the wcinkey function */ #endif /* HAVE_WCHAR */ -extern short state; /* storage declared in getch.c */ +extern short _cursesi_state; /* storage declared in getch.c */ /* prototypes for private functions */ #ifdef HAVE_WCHAR @@ -222,7 +222,7 @@ inkey(wchar_t *wc, int to, int delay) *working = *start = ( *start + 1 ) % MAX_CBUF_SIZE; if (*start == *end) { - state = wstate = INKEY_NORM; + _cursesi_state = wstate = INKEY_NORM; #ifdef DEBUG __CTRACE(__CTRACE_INPUT, "inkey: WCASSEMBLING=>NORM, " @@ -230,7 +230,7 @@ inkey(wchar_t *wc, int to, int delay) *start, *working, *end); #endif /* DEBUG */ } else { - state = wstate = INKEY_BACKOUT; + _cursesi_state = wstate = INKEY_BACKOUT; #ifdef DEBUG __CTRACE(__CTRACE_INPUT, "inkey: WCASSEMBLING=>BACKOUT, " @@ -289,7 +289,7 @@ inkey(wchar_t *wc, int to, int delay) } if (*start == *end) { /* only one char processed */ - state = wstate = INKEY_NORM; + _cursesi_state = wstate = INKEY_NORM; #ifdef DEBUG __CTRACE(__CTRACE_INPUT, "inkey: WCASSEMBLING=>NORM, " @@ -298,7 +298,7 @@ inkey(wchar_t *wc, int to, int delay) #endif /* DEBUG */ } else { /* otherwise we must have more than one char to backout */ - state = wstate = INKEY_BACKOUT; + _cursesi_state = wstate = INKEY_BACKOUT; #ifdef DEBUG __CTRACE(__CTRACE_INPUT, "inkey: WCASSEMBLING=>BACKOUT, " @@ -385,7 +385,7 @@ inkey(wchar_t *wc, int to, int delay) } if (*start == *end) { /* only one char processed */ -state = wstate = INKEY_NORM; +_cursesi_state = wstate = INKEY_NORM; #ifdef DEBUG __CTRACE(__CTRACE_INPUT, "inkey: Empty cbuf=>NORM, " @@ -394,7 +394,7 @@ inkey(wchar_t *wc, int to, int delay) #endif /* DEBUG */ } else { /* otherwise we must have more than one char to backout */ -state = wstate = INKEY_BACKOUT; +_cursesi_state = wstate = INKEY_BACKOUT; #ifdef DEBUG __CTRACE(__CTRACE_INPUT, "inkey: Non-empty cbuf=>BACKOUT, " @@ -418,7 +418,7 @@ inkey(wchar_t *wc, int to, int delay) #endif /* DEBUG */ if (*start == *end) { /* if it is go back to normal */ - state = wstate = INKEY_NORM; + _cursesi_state = wstate = INKEY_NORM; #ifdef DEBUG __CTRACE(__CTRACE_INPUT, "[inkey]=>NORM, start(%d), " @@ -427,7 +427,7 @@ inkey(wchar_t *wc, int to, int delay) #endif /* DEBUG */ } else { /* otherwise go to backout state */ - state = wstate = INKEY_BACKOUT; + _cursesi_state = wstate = INKEY_BACKOUT; #ifdef DEBUG __CTRACE(__CTRACE_INPUT, "[inkey]=>BACKOUT, start(%d), " Index: src/lib/libcurses/getch.c diff -u src/lib/libcurses/getch.c:1.59 src/lib/libcurses/getch.c:1.59.10.1 --- src/lib/libcurses/getch.c:1.59 Sat Apr 21 12:27:28 2012 +++ src/lib/libcurses/getch.c Fri Mar 15 14:36:22 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: getch.c,v 1.59 2012/04/21 12:27:28 roy Exp $ */ +/* $NetBSD: getch.c,v 1.59.10.1 2019/03/15 14:36:22 martin Exp $ */ /* * Copyri
CVS commit: [netbsd-7] src/lib/libcurses
Module Name:src Committed By: riz Date: Sat Nov 7 16:38:22 UTC 2015 Modified Files: src/lib/libcurses [netbsd-7]: toucholap.c Log Message: Pull up following revision(s) (requested by uwe in ticket #1007): lib/libcurses/toucholap.c: revision 1.16 Fix x/y edito. To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.15.54.1 src/lib/libcurses/toucholap.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libcurses/toucholap.c diff -u src/lib/libcurses/toucholap.c:1.15 src/lib/libcurses/toucholap.c:1.15.54.1 --- src/lib/libcurses/toucholap.c:1.15 Sun Jan 21 13:25:36 2007 +++ src/lib/libcurses/toucholap.c Sat Nov 7 16:38:22 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: toucholap.c,v 1.15 2007/01/21 13:25:36 jdc Exp $ */ +/* $NetBSD: toucholap.c,v 1.15.54.1 2015/11/07 16:38:22 riz Exp $ */ /* * Copyright (c) 1981, 1993, 1994 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)toucholap.c 8.2 (Berkeley) 5/4/94"; #else -__RCSID("$NetBSD: toucholap.c,v 1.15 2007/01/21 13:25:36 jdc Exp $"); +__RCSID("$NetBSD: toucholap.c,v 1.15.54.1 2015/11/07 16:38:22 riz Exp $"); #endif #endif/* not lint */ @@ -55,7 +55,7 @@ touchoverlap(WINDOW *win1, WINDOW *win2) #endif starty = max(win1->begy, win2->begy); startx = max(win1->begx, win2->begx); - endy = min(win1->maxy + win1->begy, win2->maxy + win2->begx); + endy = min(win1->maxy + win1->begy, win2->maxy + win2->begy); endx = min(win1->maxx + win1->begx, win2->maxx + win2->begx); #ifdef DEBUG __CTRACE(__CTRACE_WINDOW, "touchoverlap: from (%d,%d) to (%d,%d)\n",
CVS commit: [netbsd-7] src/lib/libcurses
Module Name:src Committed By: martin Date: Thu Aug 9 14:38:16 UTC 2018 Modified Files: src/lib/libcurses [netbsd-7]: addbytes.c Log Message: Pull up following revision(s) (requested by simonb in ticket #1627): lib/libcurses/addbytes.c: revision 1.48 Avoid curx going beyond end of window when adding a wide character to the last column. OK @blymn. To generate a diff of this commit: cvs rdiff -u -r1.42 -r1.42.4.1 src/lib/libcurses/addbytes.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libcurses/addbytes.c diff -u src/lib/libcurses/addbytes.c:1.42 src/lib/libcurses/addbytes.c:1.42.4.1 --- src/lib/libcurses/addbytes.c:1.42 Sun Nov 10 03:14:16 2013 +++ src/lib/libcurses/addbytes.c Thu Aug 9 14:38:16 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: addbytes.c,v 1.42 2013/11/10 03:14:16 christos Exp $ */ +/* $NetBSD: addbytes.c,v 1.42.4.1 2018/08/09 14:38:16 martin Exp $ */ /* * Copyright (c) 1987, 1993, 1994 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)addbytes.c 8.4 (Berkeley) 5/4/94"; #else -__RCSID("$NetBSD: addbytes.c,v 1.42 2013/11/10 03:14:16 christos Exp $"); +__RCSID("$NetBSD: addbytes.c,v 1.42.4.1 2018/08/09 14:38:16 martin Exp $"); #endif #endif/* not lint */ @@ -572,7 +572,7 @@ _cursesi_addwchar(WINDOW *win, __LINE ** if (newx > *(*lnp)->lastchp) *(*lnp)->lastchp = newx; __touchline(win, *y, sx, (int) win->maxx - 1); - win->curx = sx; + *x = win->curx = sx; } else { win->curx = *x;
CVS commit: [netbsd-7] src/lib/libcurses
Module Name:src Committed By: snj Date: Mon Jun 1 19:26:26 UTC 2015 Modified Files: src/lib/libcurses [netbsd-7]: unctrl.h Log Message: Pull up following revision(s) (requested by wiz in ticket #811): lib/libcurses/unctrl.h: revision 1.5 Fix quoting in macro. Needed by dialog-1.2-20150513. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.4.54.1 src/lib/libcurses/unctrl.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libcurses/unctrl.h diff -u src/lib/libcurses/unctrl.h:1.4 src/lib/libcurses/unctrl.h:1.4.54.1 --- src/lib/libcurses/unctrl.h:1.4 Mon May 28 15:01:58 2007 +++ src/lib/libcurses/unctrl.h Mon Jun 1 19:26:26 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: unctrl.h,v 1.4 2007/05/28 15:01:58 blymn Exp $ */ +/* $NetBSD: unctrl.h,v 1.4.54.1 2015/06/01 19:26:26 snj Exp $ */ /* * Copyright (c) 1982, 1993 @@ -53,6 +53,6 @@ __END_DECLS #define unctrllen(c) __unctrllen[((unsigned char)c) & 0xff] #ifdef HAVE_WCHAR -#define wunctrl(wc) __wunctrl[( int )(wc->vals[ 0 ]) & 0xff] +#define wunctrl(wc) __wunctrl[( int )((wc)->vals[ 0 ]) & 0xff] #endif /* HAVE_WCHAR */ #endif /* _UNCTRL_H_ */
CVS commit: [netbsd-7] src/lib/libcurses
Module Name:src Committed By: snj Date: Wed Jun 10 16:59:32 UTC 2015 Modified Files: src/lib/libcurses [netbsd-7]: curses.h Log Message: Pull up following revision(s) (requested by joerg in ticket #836): lib/libcurses/curses.h: revision 1.107 mvgetnstr should have a length argument as the name implies. To generate a diff of this commit: cvs rdiff -u -r1.106 -r1.106.4.1 src/lib/libcurses/curses.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libcurses/curses.h diff -u src/lib/libcurses/curses.h:1.106 src/lib/libcurses/curses.h:1.106.4.1 --- src/lib/libcurses/curses.h:1.106 Wed Oct 16 19:59:29 2013 +++ src/lib/libcurses/curses.h Wed Jun 10 16:59:32 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: curses.h,v 1.106 2013/10/16 19:59:29 roy Exp $ */ +/* $NetBSD: curses.h,v 1.106.4.1 2015/06/10 16:59:32 snj Exp $ */ /* * Copyright (c) 1981, 1993, 1994 @@ -480,7 +480,7 @@ extern int TABSIZE; /* Size of a tab. #define mvaddstr(y, x, s) mvwaddstr(stdscr, y, x, s) #define mvdelch(y, x) mvwdelch(stdscr, y, x) #define mvgetch(y, x) mvwgetch(stdscr, y, x) -#define mvgetnstr(y, x, s) mvwgetnstr(stdscr, y, x, s, n) +#define mvgetnstr(y, x, s, n) mvwgetnstr(stdscr, y, x, s, n) #define mvgetstr(y, x, s) mvwgetstr(stdscr, y, x, s) #define mvinch(y, x) mvwinch(stdscr, y, x) #define mvinchnstr(y, x, c, n) mvwinchnstr(stdscr, y, x, c, n)