CVS commit: [netbsd-6] src/lib/libcurses
Module Name:src Committed By: bouyer Date: Sun Nov 15 20:47:11 UTC 2015 Modified Files: src/lib/libcurses [netbsd-6]: toucholap.c Log Message: Pull up following revision(s) (requested by uwe in ticket #1337): 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.36.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.36.1 --- src/lib/libcurses/toucholap.c:1.15 Sun Jan 21 13:25:36 2007 +++ src/lib/libcurses/toucholap.c Sun Nov 15 20:47:11 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.36.1 2015/11/15 20:47:11 bouyer 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.36.1 2015/11/15 20:47:11 bouyer 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-6] src/lib/libcurses
Module Name:src Committed By: snj Date: Fri Jun 19 17:17:59 UTC 2015 Modified Files: src/lib/libcurses [netbsd-6]: unctrl.h Log Message: Pull up following revision(s) (requested by wiz in ticket #1302): 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.36.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.36.1 --- src/lib/libcurses/unctrl.h:1.4 Mon May 28 15:01:58 2007 +++ src/lib/libcurses/unctrl.h Fri Jun 19 17:17:59 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.36.1 2015/06/19 17:17:59 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-6] src/lib/libcurses
Module Name:src Committed By: snj Date: Fri Jun 19 17:16:11 UTC 2015 Modified Files: src/lib/libcurses [netbsd-6]: curses.h Log Message: Pull up following revision(s) (requested by joerg in ticket #1307): 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.103 -r1.103.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.103 src/lib/libcurses/curses.h:1.103.4.1 --- src/lib/libcurses/curses.h:1.103 Tue Oct 4 11:01:13 2011 +++ src/lib/libcurses/curses.h Fri Jun 19 17:16:11 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: curses.h,v 1.103 2011/10/04 11:01:13 roy Exp $ */ +/* $NetBSD: curses.h,v 1.103.4.1 2015/06/19 17:16:11 snj Exp $ */ /* * Copyright (c) 1981, 1993, 1994 @@ -478,7 +478,7 @@ extern int ESCDELAY; /* Delay between #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)
CVS commit: [netbsd-6] src/lib/libcurses
Module Name:src Committed By: riz Date: Thu Sep 26 14:20:03 UTC 2013 Modified Files: src/lib/libcurses [netbsd-6]: setterm.c Log Message: Pull up following revision(s) (requested by dsainty in ticket #960): lib/libcurses/setterm.c: revision 1.51 Fix a NULL dereference if the exit_alt_charset_mode capability is not defined. The previous version of this file changed a terminal initialisation test on the exit_attribute_mode capability, checking for the exit_alt_charset_mode capability as a substring, rather than performing a search for the hard-coded ^O character. That works better on terminals where ^O is not the correct value for exit_alt_charset_mode. But it works worse on terminals that don't have a definition specified for exit_alt_charset_mode. For example: % TERMCAP='xterm:me=\E[m:' TERM=xterm vi segmentation fault (core dumped) TERMCAP='xterm:me=\E[m:' TERM=xterm vi The crash can be avoided (without fixing the bug) by defining exit_alt_charset_mode: % TERMCAP='xterm|:me=\E[m:ae=:' TERM=xterm vi ex/vi: Error: xterm: No such process We now test exit_alt_charset_mode for NULL before continuing with the fatal test, restoring the original no-crash behaviour. XXX does_ctrl_o() is now just a naive reimplementation of strstr(), so should probably just use strstr() instead. To generate a diff of this commit: cvs rdiff -u -r1.48.4.1 -r1.48.4.2 src/lib/libcurses/setterm.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/setterm.c diff -u src/lib/libcurses/setterm.c:1.48.4.1 src/lib/libcurses/setterm.c:1.48.4.2 --- src/lib/libcurses/setterm.c:1.48.4.1 Sat May 11 21:48:23 2013 +++ src/lib/libcurses/setterm.c Thu Sep 26 14:20:03 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: setterm.c,v 1.48.4.1 2013/05/11 21:48:23 riz Exp $ */ +/* $NetBSD: setterm.c,v 1.48.4.2 2013/09/26 14:20:03 riz Exp $ */ /* * Copyright (c) 1981, 1993, 1994 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)setterm.c 8.8 (Berkeley) 10/25/94"; #else -__RCSID("$NetBSD: setterm.c,v 1.48.4.1 2013/05/11 21:48:23 riz Exp $"); +__RCSID("$NetBSD: setterm.c,v 1.48.4.2 2013/09/26 14:20:03 riz Exp $"); #endif #endif /* not lint */ @@ -172,6 +172,7 @@ _cursesi_setterm(char *type, SCREEN *scr * It might turn off ACS, so check for that. */ if (t_exit_attribute_mode(screen->term) != NULL && + t_exit_alt_charset_mode(screen->term) != NULL && does_ctrl_o(t_exit_attribute_mode(screen->term), t_exit_alt_charset_mode(screen->term))) screen->mask_me = 0;
CVS commit: [netbsd-6] src/lib/libcurses
Module Name:src Committed By: riz Date: Sat May 11 21:48:23 UTC 2013 Modified Files: src/lib/libcurses [netbsd-6]: setterm.c Log Message: Pull up following revision(s) (requested by jdc in ticket #885): lib/libcurses/setterm.c: revision 1.50 Extend does_ctrl_o() to compare exit attribute and ext ACS sequences. To generate a diff of this commit: cvs rdiff -u -r1.48 -r1.48.4.1 src/lib/libcurses/setterm.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/setterm.c diff -u src/lib/libcurses/setterm.c:1.48 src/lib/libcurses/setterm.c:1.48.4.1 --- src/lib/libcurses/setterm.c:1.48 Tue Oct 4 11:01:14 2011 +++ src/lib/libcurses/setterm.c Sat May 11 21:48:23 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: setterm.c,v 1.48 2011/10/04 11:01:14 roy Exp $ */ +/* $NetBSD: setterm.c,v 1.48.4.1 2013/05/11 21:48:23 riz Exp $ */ /* * Copyright (c) 1981, 1993, 1994 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)setterm.c 8.8 (Berkeley) 10/25/94"; #else -__RCSID("$NetBSD: setterm.c,v 1.48 2011/10/04 11:01:14 roy Exp $"); +__RCSID("$NetBSD: setterm.c,v 1.48.4.1 2013/05/11 21:48:23 riz Exp $"); #endif #endif /* not lint */ @@ -49,7 +49,7 @@ __RCSID("$NetBSD: setterm.c,v 1.48 2011/ #include "curses_private.h" static int does_esc_m(const char *cap); -static int does_ctrl_o(const char *cap); +static int does_ctrl_o(const char *exit_cap, const char *acs_cap); attr_t __mask_op, __mask_me, __mask_ue, __mask_se; @@ -172,7 +172,8 @@ _cursesi_setterm(char *type, SCREEN *scr * It might turn off ACS, so check for that. */ if (t_exit_attribute_mode(screen->term) != NULL && - does_ctrl_o(t_exit_attribute_mode(screen->term))) + does_ctrl_o(t_exit_attribute_mode(screen->term), + t_exit_alt_charset_mode(screen->term))) screen->mask_me = 0; else screen->mask_me = __ALTCHARSET; @@ -330,20 +331,22 @@ does_esc_m(const char *cap) /* * does_ctrl_o -- * A hack for vt100/xterm-like terminals where the "me" capability also - * unsets acs (i.e. it contains the character '\017'). + * unsets acs. */ static int -does_ctrl_o(const char *cap) +does_ctrl_o(const char *exit_cap, const char *acs_cap) { - const char *capptr = cap; + const char *eptr = exit_cap, *aptr = acs_cap; + int l; #ifdef DEBUG - __CTRACE(__CTRACE_INIT, "does_ctrl_o: Looping on %s\n", capptr); + __CTRACE(__CTRACE_INIT, "does_ctrl_o: Testing %s for %s\n", eptr, aptr); #endif - while (*capptr != 0) { - if (*capptr == '\x0f') + l = strlen(acs_cap); + while (*eptr != 0) { + if (!strncmp(eptr, aptr, l)) return 1; - capptr++; + eptr++; } return 0; }
CVS commit: [netbsd-6] src/lib/libcurses
Module Name:src Committed By: riz Date: Sat May 11 21:46:26 UTC 2013 Modified Files: src/lib/libcurses [netbsd-6]: border.c Log Message: Pull up following revision(s) (requested by jdc in ticket #884): lib/libcurses/border.c: revision 1.15 Also merge in background attributes. To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.14.8.1 src/lib/libcurses/border.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/border.c diff -u src/lib/libcurses/border.c:1.14 src/lib/libcurses/border.c:1.14.8.1 --- src/lib/libcurses/border.c:1.14 Sat Dec 25 09:59:52 2010 +++ src/lib/libcurses/border.c Sat May 11 21:46:26 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: border.c,v 1.14 2010/12/25 09:59:52 blymn Exp $ */ +/* $NetBSD: border.c,v 1.14.8.1 2013/05/11 21:46:26 riz Exp $ */ /* * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include #ifndef lint -__RCSID("$NetBSD: border.c,v 1.14 2010/12/25 09:59:52 blymn Exp $"); +__RCSID("$NetBSD: border.c,v 1.14.8.1 2013/05/11 21:46:26 riz Exp $"); #endif/* not lint */ #include @@ -261,20 +261,36 @@ int wborder_set(WINDOW *win, const cchar /* Merge window attributes */ left.attributes |= (left.attributes & __COLOR) ? (win->wattr & ~__COLOR) : win->wattr; + left.attributes |= (left.attributes & __COLOR) ? + (win->battr & ~__COLOR) : win->battr; right.attributes |= (right.attributes & __COLOR) ? (win->wattr & ~__COLOR) : win->wattr; + right.attributes |= (right.attributes & __COLOR) ? + (win->battr & ~__COLOR) : win->battr; top.attributes |= (top.attributes & __COLOR) ? (win->wattr & ~__COLOR) : win->wattr; + top.attributes |= (top.attributes & __COLOR) ? + (win->battr & ~__COLOR) : win->battr; bottom.attributes |= (bottom.attributes & __COLOR) ? (win->wattr & ~__COLOR) : win->wattr; + bottom.attributes |= (bottom.attributes & __COLOR) ? + (win->battr & ~__COLOR) : win->battr; topleft.attributes |= (topleft.attributes & __COLOR) ? (win->wattr & ~__COLOR) : win->wattr; + topleft.attributes |= (topleft.attributes & __COLOR) ? + (win->battr & ~__COLOR) : win->battr; topright.attributes |= (topright.attributes & __COLOR) ? (win->wattr & ~__COLOR) : win->wattr; + topright.attributes |= (topright.attributes & __COLOR) ? + (win->battr & ~__COLOR) : win->battr; botleft.attributes |= (botleft.attributes & __COLOR) ? (win->wattr & ~__COLOR) : win->wattr; + botleft.attributes |= (botleft.attributes & __COLOR) ? + (win->battr & ~__COLOR) : win->battr; botright.attributes |= (botright.attributes & __COLOR) ? (win->wattr & ~__COLOR) : win->wattr; + botright.attributes |= (botright.attributes & __COLOR) ? + (win->battr & ~__COLOR) : win->battr; endx = win->maxx - 1; endy = win->maxy - 1;
CVS commit: [netbsd-6] src/lib/libcurses
Module Name:src Committed By: bouyer Date: Sat Mar 17 17:51:48 UTC 2012 Modified Files: src/lib/libcurses [netbsd-6]: clrtobot.c clrtoeol.c Log Message: Pull up following revision(s) (requested by blymn in ticket #121): lib/libcurses/clrtoeol.c: revision 1.26 lib/libcurses/clrtobot.c: revision 1.22 PR/46049: Tim van der Molen: clrtobot() and clrtoeol() do not set background attributes To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.21.8.1 src/lib/libcurses/clrtobot.c cvs rdiff -u -r1.25 -r1.25.8.1 src/lib/libcurses/clrtoeol.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/clrtobot.c diff -u src/lib/libcurses/clrtobot.c:1.21 src/lib/libcurses/clrtobot.c:1.21.8.1 --- src/lib/libcurses/clrtobot.c:1.21 Wed Jul 22 16:57:14 2009 +++ src/lib/libcurses/clrtobot.c Sat Mar 17 17:51:47 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: clrtobot.c,v 1.21 2009/07/22 16:57:14 roy Exp $ */ +/* $NetBSD: clrtobot.c,v 1.21.8.1 2012/03/17 17:51:47 bouyer Exp $ */ /* * Copyright (c) 1981, 1993, 1994 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)clrtobot.c 8.2 (Berkeley) 5/4/94"; #else -__RCSID("$NetBSD: clrtobot.c,v 1.21 2009/07/22 16:57:14 roy Exp $"); +__RCSID("$NetBSD: clrtobot.c,v 1.21.8.1 2012/03/17 17:51:47 bouyer Exp $"); #endif #endif/* not lint */ @@ -77,8 +77,8 @@ wclrtobot(WINDOW *win) starty = win->cury; startx = win->curx; } - if (__using_color && win != curscr) - attr = win->battr & __COLOR; + if (win != curscr) + attr = win->battr & __ATTRIBUTES; else attr = 0; for (y = starty; y < win->maxy; y++) { @@ -89,12 +89,15 @@ wclrtobot(WINDOW *win) if (sp->ch != win->bch || sp->attr != attr) { #else if (sp->ch != (wchar_t)btowc((int) win->bch) || - (sp->attr & WA_ATTRIBUTES) != 0 || sp->nsp) { + (sp->attr & WA_ATTRIBUTES) != attr || sp->nsp) { #endif /* HAVE_WCHAR */ maxx = sp; if (minx == -1) minx = (int)(sp - win->alines[y]->line); -sp->attr = attr; +if (sp->attr & __ALTCHARSET) + sp->attr = attr | __ALTCHARSET; +else + sp->attr = attr; #ifdef HAVE_WCHAR sp->ch = ( wchar_t )btowc(( int ) win->bch); if (_cursesi_copy_nsp(win->bnsp, sp) == ERR) Index: src/lib/libcurses/clrtoeol.c diff -u src/lib/libcurses/clrtoeol.c:1.25 src/lib/libcurses/clrtoeol.c:1.25.8.1 --- src/lib/libcurses/clrtoeol.c:1.25 Wed Jul 22 16:57:14 2009 +++ src/lib/libcurses/clrtoeol.c Sat Mar 17 17:51:47 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: clrtoeol.c,v 1.25 2009/07/22 16:57:14 roy Exp $ */ +/* $NetBSD: clrtoeol.c,v 1.25.8.1 2012/03/17 17:51:47 bouyer Exp $ */ /* * Copyright (c) 1981, 1993, 1994 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)clrtoeol.c 8.2 (Berkeley) 5/4/94"; #else -__RCSID("$NetBSD: clrtoeol.c,v 1.25 2009/07/22 16:57:14 roy Exp $"); +__RCSID("$NetBSD: clrtoeol.c,v 1.25.8.1 2012/03/17 17:51:47 bouyer Exp $"); #endif #endif/* not lint */ @@ -82,8 +82,8 @@ wclrtoeol(WINDOW *win) end = &win->alines[y]->line[win->maxx]; minx = -1; maxx = &win->alines[y]->line[x]; - if (__using_color && win != curscr) - attr = win->battr & __COLOR; + if (win != curscr) + attr = win->battr & __ATTRIBUTES; else attr = 0; for (sp = maxx; sp < end; sp++) @@ -97,7 +97,7 @@ wclrtoeol(WINDOW *win) maxx = sp; if (minx == -1) minx = (int) (sp - win->alines[y]->line); - sp->attr = attr; + sp->attr = attr | (sp->attr & __ALTCHARSET); #ifdef HAVE_WCHAR sp->ch = ( wchar_t )btowc(( int ) win->bch); if (_cursesi_copy_nsp(win->bnsp, sp) == ERR)