CVS commit: src/tests/lib/libcurses/director

2024-07-18 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Thu Jul 18 22:10:51 UTC 2024

Modified Files:
src/tests/lib/libcurses/director: director.c testlang_parse.y

Log Message:
Add a nofail (-n) option so that the director will not exit when the
test output does not match the check file.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/tests/lib/libcurses/director/director.c
cvs rdiff -u -r1.54 -r1.55 src/tests/lib/libcurses/director/testlang_parse.y

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/director/director.c
diff -u src/tests/lib/libcurses/director/director.c:1.29 src/tests/lib/libcurses/director/director.c:1.30
--- src/tests/lib/libcurses/director/director.c:1.29	Thu Jun 10 07:21:07 2021
+++ src/tests/lib/libcurses/director/director.c	Thu Jul 18 22:10:51 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: director.c,v 1.29 2021/06/10 07:21:07 mcf Exp $	*/
+/*	$NetBSD: director.c,v 1.30 2024/07/18 22:10:51 blymn Exp $	*/
 
 /*-
  * Copyright 2009 Brett Lymn 
@@ -57,6 +57,7 @@ saved_data_t  saved_output;	/* In testla
 int to_slave;
 int from_slave;
 int master;			/* pty to the slave */
+int nofail;			/* don't exit on check file fail */
 int verbose;			/* control verbosity of tests */
 int check_file_flag;		/* control check-file generation */
 const char *check_path;		/* path to prepend to check files for output
@@ -136,10 +137,11 @@ main(int argc, char *argv[])
 	int pipe_to_slave[2], pipe_from_slave[2];
 
 	termpath = term = slave = NULL;
+	nofail = 0;
 	verbose = 0;
 	check_file_flag = 0;
 
-	while ((ch = getopt(argc, argv, "vgfC:s:t:T:")) != -1) {
+	while ((ch = getopt(argc, argv, "nvgfC:s:t:T:")) != -1) {
 		switch (ch) {
 		case 'C':
 			check_path = optarg;
@@ -147,6 +149,9 @@ main(int argc, char *argv[])
 		case 'T':
 			termpath = optarg;
 			break;
+		case 'n':
+			nofail = 1;
+			break;
 		case 's':
 			slave = optarg;
 			break;

Index: src/tests/lib/libcurses/director/testlang_parse.y
diff -u src/tests/lib/libcurses/director/testlang_parse.y:1.54 src/tests/lib/libcurses/director/testlang_parse.y:1.55
--- src/tests/lib/libcurses/director/testlang_parse.y:1.54	Sun Dec 10 15:51:13 2023
+++ src/tests/lib/libcurses/director/testlang_parse.y	Thu Jul 18 22:10:51 2024
@@ -1,5 +1,5 @@
 %{
-/*	$NetBSD: testlang_parse.y,v 1.54 2023/12/10 15:51:13 rillig Exp $	*/
+/*	$NetBSD: testlang_parse.y,v 1.55 2024/07/18 22:10:51 blymn Exp $	*/
 
 /*-
  * Copyright 2009 Brett Lymn 
@@ -55,6 +55,7 @@ extern int master;
 extern struct pollfd readfd;
 extern char *check_path;
 extern char *cur_file;		/* from director.c */
+extern int nofail;		/* from director.c */
 
 int yylex(void);
 
@@ -1004,7 +1005,7 @@ compare_streams(const char *filename, bo
 	data, (data >= ' ' )? data : '-');
 		}
 
-		if (!create_check_file && ref != data) {
+		if (!nofail && !create_check_file && ref != data) {
 			errx(2, "%s:%zu: refresh data from slave does "
 			"not match expected from file %s offset %zu "
 			"[reference 0x%02x (%c) != slave 0x%02x (%c)]",
@@ -1029,7 +1030,7 @@ compare_streams(const char *filename, bo
 	}
 
 	/* discard any excess saved output if required */
-	if (discard) {
+	if (discard || nofail) {
 		saved_output.count = 0;
 		saved_output.readp = 0;
 	}



CVS commit: src/tests/lib/libcurses/director

2024-07-18 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Thu Jul 18 22:10:51 UTC 2024

Modified Files:
src/tests/lib/libcurses/director: director.c testlang_parse.y

Log Message:
Add a nofail (-n) option so that the director will not exit when the
test output does not match the check file.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/tests/lib/libcurses/director/director.c
cvs rdiff -u -r1.54 -r1.55 src/tests/lib/libcurses/director/testlang_parse.y

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses

2024-07-18 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Thu Jul 18 07:15:26 UTC 2024

Modified Files:
src/tests/lib/libcurses: debug_test

Log Message:
* Fix a bug where specifying -t would cause the director args to be
  truncated.

* Add support for the director nofail option.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/lib/libcurses/debug_test

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/debug_test
diff -u src/tests/lib/libcurses/debug_test:1.7 src/tests/lib/libcurses/debug_test:1.8
--- src/tests/lib/libcurses/debug_test:1.7	Tue Mar  1 06:41:27 2022
+++ src/tests/lib/libcurses/debug_test	Thu Jul 18 07:15:26 2024
@@ -26,10 +26,13 @@ usage() {
 	echo " ${CURSES_TRACE_FILE}"
 	echo "	  -L : Add the argument as a prefix to LD_LIBRARY_PATH to"
 	echo "	   use an alternate libcurses version"
+	echo "-n : Add the nofail option to the director invocation"
+	echo "   : so the director won't exit on check_file mismatch"
 	echo "-s : Specify the slave command.  Defaults to \"../slave/slave\""
 	echo "-v : Enable verbose output"
 	echo "-g : Enable check file generation if the file does not exists"
 	echo "-f : Forces check file generation if -g flag is set"
+	echo "-t : Specify the TERM to use for the tests"
 	echo
 }
 
@@ -41,7 +44,7 @@ usage() {
 #ARGS="-T ${BASEDIR} -I ${INCLUDE_PATH} -C ${CHECK_PATH}"
 ARGS="-T ${BASEDIR} -C ${CHECK_PATH}"
 #
-while getopts cf:F:L:s:vg opt
+while getopts cf:F:L:ns:t:vg opt
 do
 case "${opt}" in
 	c)
@@ -60,10 +63,18 @@ do
 	LD_LIBRARY_PATH=${OPTARG}:${LD_LIBRARY_PATH}
 	;;
 
+	n)
+	ARGS="-n ${ARGS} "
+	;;
+
 	s)
 	SLAVE=${OPTARG}
 	;;
 
+	t)
+	ARGS="-t ${OPTARG} ${ARGS}"
+	;;
+
 	v)
 	ARGS="-v ${ARGS}"
 	;;



CVS commit: src/tests/lib/libcurses

2024-07-18 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Thu Jul 18 07:15:26 UTC 2024

Modified Files:
src/tests/lib/libcurses: debug_test

Log Message:
* Fix a bug where specifying -t would cause the director args to be
  truncated.

* Add support for the director nofail option.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/lib/libcurses/debug_test

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses/check_files

2024-07-11 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Thu Jul 11 07:14:20 UTC 2024

Modified Files:
src/tests/lib/libcurses/check_files: color_blank_draw.chk slk6.chk

Log Message:
Fix the check files to account for new colour setting behaviour.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/tests/lib/libcurses/check_files/color_blank_draw.chk
cvs rdiff -u -r1.4 -r1.5 src/tests/lib/libcurses/check_files/slk6.chk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses/check_files

2024-07-11 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Thu Jul 11 07:14:20 UTC 2024

Modified Files:
src/tests/lib/libcurses/check_files: color_blank_draw.chk slk6.chk

Log Message:
Fix the check files to account for new colour setting behaviour.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/tests/lib/libcurses/check_files/color_blank_draw.chk
cvs rdiff -u -r1.4 -r1.5 src/tests/lib/libcurses/check_files/slk6.chk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/check_files/color_blank_draw.chk
diff -u src/tests/lib/libcurses/check_files/color_blank_draw.chk:1.2 src/tests/lib/libcurses/check_files/color_blank_draw.chk:1.3
--- src/tests/lib/libcurses/check_files/color_blank_draw.chk:1.2	Tue Apr 12 07:04:19 2022
+++ src/tests/lib/libcurses/check_files/color_blank_draw.chk	Thu Jul 11 07:14:20 2024
@@ -1,24 +1,24 @@
 setaf7Xsetab0Xel
-setaf7Xsetab0Xel
-setaf7Xsetab0Xel
-setaf7Xsetab0Xel
-setaf7Xsetab0Xel
-setaf7Xsetab0Xel
-setaf7Xsetab0Xel
-setaf7Xsetab0Xel
-setaf7Xsetab0Xel
-setaf7Xsetab0Xel
-setaf7Xsetab0Xel
-setaf7Xsetab0Xel
-setaf7Xsetab0Xel
-setaf7Xsetab0Xel
-setaf7Xsetab0Xel
-setaf7Xsetab0Xel
-setaf7Xsetab0Xel
-setaf7Xsetab0Xel
-setaf7Xsetab0Xel
-setaf7Xsetab0Xel
-setaf7Xsetab0Xel
-setaf7Xsetab0Xel
-setaf7Xsetab0Xel
-setaf7Xsetab0Xelhomeop
\ No newline at end of file
+el
+el
+el
+el
+el
+el
+el
+el
+el
+el
+el
+el
+el
+el
+el
+el
+el
+el
+el
+el
+el
+el
+elhomeop
\ No newline at end of file

Index: src/tests/lib/libcurses/check_files/slk6.chk
diff -u src/tests/lib/libcurses/check_files/slk6.chk:1.4 src/tests/lib/libcurses/check_files/slk6.chk:1.5
--- src/tests/lib/libcurses/check_files/slk6.chk:1.4	Tue Apr 12 07:04:19 2022
+++ src/tests/lib/libcurses/check_files/slk6.chk	Thu Jul 11 07:14:20 2024
@@ -1 +1 @@
-opsetaf7Xsetab0Xsmulrev setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0Xosetaf7Xsetab0Xnsetaf7Xsetab0Xesgr0setaf7Xsetab0X setaf7Xsetab0Xsmulrev setaf7Xsetab0X setaf7Xsetab0Xtsetaf7Xsetab0Xwsetaf7Xsetab0Xosetaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X sgr0setaf7Xsetab0X setaf7Xsetab0Xsmulrev setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X sgr0setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X setaf1Xsetab2Xsmulrev setaf1Xsetab2X setaf1Xsetab2X setaf1Xsetab2X setaf1Xsetab2Xfsetaf1Xsetab2Xosetaf1Xsetab2Xusetaf1Xsetab2Xrsgr0setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0Xsmulrev setaf7Xsetab0X setaf7Xsetab0Xfsetaf7Xsetab0Xisetaf7Xsetab0Xvsetaf7Xsetab0Xesetaf7Xsetab0X setaf7Xsetab0X sgr0setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0Xsmulrev setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X sg
 r0setaf7Xsetab0X setaf7Xsetab0Xsmulrev setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X sgr0setaf7Xsetab0X setaf7Xsetab0Xsmulrevesetaf7Xsetab0Xisetaf7Xsetab0Xgsetaf7Xsetab0Xhsetaf7Xsetab0Xtsetaf7Xsetab0X!setaf7Xsetab0X!rmamsetaf7Xsetab0X!smamcup24;40Xrmulsgr0op
\ No newline at end of file
+opsetaf7Xsetab0Xsmulrev onesgr0 smulrev  two   sgr0 smulrevsgr0 setaf1Xsetab2Xsmulrevfoursgr0setaf7Xsetab0X  smulrev  five  sgr0 smulrevsgr0 smulrevsgr0 smulreveight!!rmam!smamcup24;40Xrmulsgr0op
\ No newline at end of file



CVS commit: src/lib/libcurses

2024-07-11 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Thu Jul 11 07:13:41 UTC 2024

Modified Files:
src/lib/libcurses: color.c curses_private.h screen.c

Log Message:
PR lib/58282

This is a partial fix for the issues raised.  This change will
reduce the output by preventing the foreground and background
colours being set on each cell.  The current colour pair applied
is tracked and requests to set the colour to the same pair is now
a no-op.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/lib/libcurses/color.c
cvs rdiff -u -r1.81 -r1.82 src/lib/libcurses/curses_private.h
cvs rdiff -u -r1.39 -r1.40 src/lib/libcurses/screen.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/color.c
diff -u src/lib/libcurses/color.c:1.47 src/lib/libcurses/color.c:1.48
--- src/lib/libcurses/color.c:1.47	Wed Oct 19 06:09:27 2022
+++ src/lib/libcurses/color.c	Thu Jul 11 07:13:41 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: color.c,v 1.47 2022/10/19 06:09:27 blymn Exp $	*/
+/*	$NetBSD: color.c,v 1.48 2024/07/11 07:13:41 blymn Exp $	*/
 
 /*
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: color.c,v 1.47 2022/10/19 06:09:27 blymn Exp $");
+__RCSID("$NetBSD: color.c,v 1.48 2024/07/11 07:13:41 blymn Exp $");
 #endif/* not lint */
 
 #include "curses.h"
@@ -123,6 +123,7 @@ start_color(void)
 
 	_cursesi_screen->COLORS = COLORS;
 	_cursesi_screen->COLOR_PAIRS = COLOR_PAIRS;
+	_cursesi_screen->curpair = -1;
 
 	/* Reset terminal colour and colour pairs. */
 	if (orig_colors != NULL)
@@ -540,6 +541,10 @@ __set_color( /*ARGSUSED*/ WINDOW *win, a
 		return;
 
 	pair = PAIR_NUMBER((uint32_t)attr);
+
+	if (pair == _cursesi_screen->curpair)
+		return;
+
 	__CTRACE(__CTRACE_COLOR, "__set_color: %d, %d, %d\n", pair,
 	_cursesi_screen->colour_pairs[pair].fore,
 	_cursesi_screen->colour_pairs[pair].back);
@@ -578,6 +583,8 @@ __set_color( /*ARGSUSED*/ WINDOW *win, a
 			0, __cputchar);
 		break;
 	}
+
+	_cursesi_screen->curpair = pair;
 	curscr->wattr &= ~__COLOR;
 	curscr->wattr |= attr & __COLOR;
 }
@@ -611,6 +618,8 @@ __unset_color(WINDOW *win)
 		}
 		break;
 	}
+
+	_cursesi_screen->curpair = -1;
 }
 
 /*
@@ -620,6 +629,12 @@ __unset_color(WINDOW *win)
 void
 __restore_colors(void)
 {
+	/*
+	 * forget foreground/background colour just in case it was
+	 * changed.  We will reset them if required.
+	 */
+	_cursesi_screen->curpair = -1;
+
 	if (can_change != 0)
 		switch (_cursesi_screen->color_type) {
 		case COLOR_HP:

Index: src/lib/libcurses/curses_private.h
diff -u src/lib/libcurses/curses_private.h:1.81 src/lib/libcurses/curses_private.h:1.82
--- src/lib/libcurses/curses_private.h:1.81	Fri May 17 23:32:50 2024
+++ src/lib/libcurses/curses_private.h	Thu Jul 11 07:13:41 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: curses_private.h,v 1.81 2024/05/17 23:32:50 uwe Exp $	*/
+/*	$NetBSD: curses_private.h,v 1.82 2024/07/11 07:13:41 blymn Exp $	*/
 
 /*-
  * Copyright (c) 1998-2000 Brett Lymn
@@ -226,6 +226,7 @@ struct __screen {
 #define	TABSIZE_DEFAULT		8   /* spaces. */
 	int	 COLORS;	/* Maximum colors on the screen */
 	int	 COLOR_PAIRS;	/* Maximum color pairs on the screen */
+	short	 curpair;	/* current colour pair set on the terminal */
 	int	 My_term;	/* Use Def_term regardless. */
 	char	 GT;		/* Gtty indicates tabs. */
 	char	 NONL;		/* Term can't hack LF doing a CR. */

Index: src/lib/libcurses/screen.c
diff -u src/lib/libcurses/screen.c:1.39 src/lib/libcurses/screen.c:1.40
--- src/lib/libcurses/screen.c:1.39	Mon May 27 14:30:43 2024
+++ src/lib/libcurses/screen.c	Thu Jul 11 07:13:41 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: screen.c,v 1.39 2024/05/27 14:30:43 uwe Exp $	*/
+/*	$NetBSD: screen.c,v 1.40 2024/07/11 07:13:41 blymn Exp $	*/
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)screen.c	8.2 (blymn) 11/27/2001";
 #else
-__RCSID("$NetBSD: screen.c,v 1.39 2024/05/27 14:30:43 uwe Exp $");
+__RCSID("$NetBSD: screen.c,v 1.40 2024/07/11 07:13:41 blymn Exp $");
 #endif
 #endif	/* not lint */
 
@@ -156,6 +156,7 @@ newterm(const char *type, FILE *outfd, F
 	new_screen->nca = A_NORMAL;
 	new_screen->color_type = COLOR_NONE;
 	new_screen->COLOR_PAIRS = 0;
+	new_screen->curpair = -1;
 	new_screen->old_mode = 1;
 	new_screen->stdbuf = NULL;
 	new_screen->stdscr = NULL;



CVS commit: src/lib/libcurses

2024-07-11 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Thu Jul 11 07:13:41 UTC 2024

Modified Files:
src/lib/libcurses: color.c curses_private.h screen.c

Log Message:
PR lib/58282

This is a partial fix for the issues raised.  This change will
reduce the output by preventing the foreground and background
colours being set on each cell.  The current colour pair applied
is tracked and requests to set the colour to the same pair is now
a no-op.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/lib/libcurses/color.c
cvs rdiff -u -r1.81 -r1.82 src/lib/libcurses/curses_private.h
cvs rdiff -u -r1.39 -r1.40 src/lib/libcurses/screen.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libcurses

2023-10-09 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Mon Oct  9 21:14:29 UTC 2023

Modified Files:
src/lib/libcurses: tty.c

Log Message:
Correct the fd closed check so we actually check the outfd as per
the comment.  Thanks for j...@netbsd.org for catching this one.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/lib/libcurses/tty.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/tty.c
diff -u src/lib/libcurses/tty.c:1.49 src/lib/libcurses/tty.c:1.50
--- src/lib/libcurses/tty.c:1.49	Mon Sep  6 07:03:50 2021
+++ src/lib/libcurses/tty.c	Mon Oct  9 21:14:29 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: tty.c,v 1.49 2021/09/06 07:03:50 rin Exp $	*/
+/*	$NetBSD: tty.c,v 1.50 2023/10/09 21:14:29 blymn Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)tty.c	8.6 (Berkeley) 1/10/95";
 #else
-__RCSID("$NetBSD: tty.c,v 1.49 2021/09/06 07:03:50 rin Exp $");
+__RCSID("$NetBSD: tty.c,v 1.50 2023/10/09 21:14:29 blymn Exp $");
 #endif
 #endif/* not lint */
 
@@ -113,7 +113,7 @@ _cursesi_gettmode(SCREEN *screen)
 
 	if (tcgetattr(fileno(screen->infd), >orig_termios)) {
 		/* if the input fd is not a tty try the output */
-		if (tcgetattr(fileno(screen->infd), >orig_termios)) {
+		if (tcgetattr(fileno(screen->outfd), >orig_termios)) {
 			/* not a tty ... we will disable tty related stuff */
 			screen->notty = TRUE;
 			__GT = 0;



CVS commit: src/lib/libcurses

2023-10-09 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Mon Oct  9 21:14:29 UTC 2023

Modified Files:
src/lib/libcurses: tty.c

Log Message:
Correct the fd closed check so we actually check the outfd as per
the comment.  Thanks for j...@netbsd.org for catching this one.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/lib/libcurses/tty.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses/check_files

2023-10-05 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Thu Oct  5 06:15:58 UTC 2023

Modified Files:
src/tests/lib/libcurses/check_files: addstr3.chk waddstr2.chk

Log Message:
Update check files affected by a fix to addbyte.c in libcurses.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/lib/libcurses/check_files/addstr3.chk
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libcurses/check_files/waddstr2.chk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses/check_files

2023-10-05 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Thu Oct  5 06:15:58 UTC 2023

Modified Files:
src/tests/lib/libcurses/check_files: addstr3.chk waddstr2.chk

Log Message:
Update check files affected by a fix to addbyte.c in libcurses.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/lib/libcurses/check_files/addstr3.chk
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libcurses/check_files/waddstr2.chk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/check_files/addstr3.chk
diff -u src/tests/lib/libcurses/check_files/addstr3.chk:1.4 src/tests/lib/libcurses/check_files/addstr3.chk:1.5
--- src/tests/lib/libcurses/check_files/addstr3.chk:1.4	Fri Nov  4 06:17:58 2022
+++ src/tests/lib/libcurses/check_files/addstr3.chk	Thu Oct  5 06:15:58 2023
@@ -1,2 +1,2 @@
-0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*cup24;1X()cup24;76Xel()clearcup23;76Xa
+0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*cup24;1X()cup24;76Xel()clearcup23;76Xa
 hello
\ No newline at end of file

Index: src/tests/lib/libcurses/check_files/waddstr2.chk
diff -u src/tests/lib/libcurses/check_files/waddstr2.chk:1.1 src/tests/lib/libcurses/check_files/waddstr2.chk:1.2
--- src/tests/lib/libcurses/check_files/waddstr2.chk:1.1	Thu Nov 10 06:13:29 2022
+++ src/tests/lib/libcurses/check_files/waddstr2.chk	Thu Oct  5 06:15:58 2023
@@ -1,3 +1,6 @@
-012345cup5;6X6cup6;8Xel
+  8el
+ 012345
+ 012345
+ 6 el
8el
  el
\ No newline at end of file



CVS commit: src/lib/libcurses

2023-10-05 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Thu Oct  5 06:15:04 UTC 2023

Modified Files:
src/lib/libcurses: addbytes.c

Log Message:
Fix for install/56467

Set x to 0 before calling scroll based on a  proposed fix by RVP (thanks!)


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 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.68 src/lib/libcurses/addbytes.c:1.69
--- src/lib/libcurses/addbytes.c:1.68	Tue Dec 20 04:57:01 2022
+++ src/lib/libcurses/addbytes.c	Thu Oct  5 06:15:03 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: addbytes.c,v 1.68 2022/12/20 04:57:01 blymn Exp $	*/
+/*	$NetBSD: addbytes.c,v 1.69 2023/10/05 06:15:03 blymn 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.68 2022/12/20 04:57:01 blymn Exp $");
+__RCSID("$NetBSD: addbytes.c,v 1.69 2023/10/05 06:15:03 blymn Exp $");
 #endif
 #endif/* not lint */
 
@@ -584,6 +584,8 @@ _cursesi_addwchar(WINDOW *win, __LINE **
 return ERR;
 			__CTRACE(__CTRACE_INPUT,
 			"_cursesi_addwchar: do a scroll\n");
+			if (!__NONL)
+*x = 0;
 			scroll(win);
 		}
 		newx = win->maxx - 1 + win->ch_off;



CVS commit: src/lib/libcurses

2023-10-05 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Thu Oct  5 06:15:04 UTC 2023

Modified Files:
src/lib/libcurses: addbytes.c

Log Message:
Fix for install/56467

Set x to 0 before calling scroll based on a  proposed fix by RVP (thanks!)


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 src/lib/libcurses/addbytes.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libcurses

2023-04-28 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Fri Apr 28 07:12:39 UTC 2023

Modified Files:
src/lib/libcurses: refresh.c

Log Message:
Don't set the clear_to_eol variable in doupdate to NULL, this was a
leftover from previous code that makes no sense and makes worms(6)
crash randomly.  Thanks to kre@ for reporting this.


To generate a diff of this commit:
cvs rdiff -u -r1.126 -r1.127 src/lib/libcurses/refresh.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/refresh.c
diff -u src/lib/libcurses/refresh.c:1.126 src/lib/libcurses/refresh.c:1.127
--- src/lib/libcurses/refresh.c:1.126	Mon Dec  5 21:14:25 2022
+++ src/lib/libcurses/refresh.c	Fri Apr 28 07:12:39 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: refresh.c,v 1.126 2022/12/05 21:14:25 blymn Exp $	*/
+/*	$NetBSD: refresh.c,v 1.127 2023/04/28 07:12:39 blymn Exp $	*/
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)refresh.c	8.7 (Berkeley) 8/13/94";
 #else
-__RCSID("$NetBSD: refresh.c,v 1.126 2022/12/05 21:14:25 blymn Exp $");
+__RCSID("$NetBSD: refresh.c,v 1.127 2023/04/28 07:12:39 blymn Exp $");
 #endif
 #endif/* not lint */
 
@@ -1382,7 +1382,6 @@ makech(int wy)
 	}
 	return OK;
 }
-ce = NULL;
 			}
 
 #ifdef HAVE_WCHAR



CVS commit: src/lib/libcurses

2023-04-28 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Fri Apr 28 07:12:39 UTC 2023

Modified Files:
src/lib/libcurses: refresh.c

Log Message:
Don't set the clear_to_eol variable in doupdate to NULL, this was a
leftover from previous code that makes no sense and makes worms(6)
crash randomly.  Thanks to kre@ for reporting this.


To generate a diff of this commit:
cvs rdiff -u -r1.126 -r1.127 src/lib/libcurses/refresh.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libcurses

2022-12-20 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Wed Dec 21 06:18:01 UTC 2022

Modified Files:
src/lib/libcurses: addnstr.c printw.c

Log Message:
Add more debug so a call to waddbytes can be traced to the caller.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/lib/libcurses/addnstr.c
cvs rdiff -u -r1.29 -r1.30 src/lib/libcurses/printw.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/addnstr.c
diff -u src/lib/libcurses/addnstr.c:1.20 src/lib/libcurses/addnstr.c:1.21
--- src/lib/libcurses/addnstr.c:1.20	Tue Oct 19 06:41:03 2021
+++ src/lib/libcurses/addnstr.c	Wed Dec 21 06:18:01 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: addnstr.c,v 1.20 2021/10/19 06:41:03 blymn Exp $	*/
+/*	$NetBSD: addnstr.c,v 1.21 2022/12/21 06:18:01 blymn Exp $	*/
 
 /*
  * Copyright (c) 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)addnstr.c	8.2 (Berkeley) 5/4/94";
 #else
-__RCSID("$NetBSD: addnstr.c,v 1.20 2021/10/19 06:41:03 blymn Exp $");
+__RCSID("$NetBSD: addnstr.c,v 1.21 2022/12/21 06:18:01 blymn Exp $");
 #endif
 #endif/* not lint */
 
@@ -52,6 +52,8 @@ __RCSID("$NetBSD: addnstr.c,v 1.20 2021/
 int
 addstr(const char *s)
 {
+	__CTRACE(__CTRACE_INPUT, "addstr: %s\n", s);
+
 	return waddnstr(stdscr, s, -1);
 }
 
@@ -62,6 +64,8 @@ addstr(const char *s)
 int
 waddstr(WINDOW *win, const char *s)
 {
+	__CTRACE(__CTRACE_INPUT, "addstr: win %p, sttring: %s\n", win, s);
+
 	return waddnstr(win, s, -1);
 }
 
@@ -73,6 +77,8 @@ waddstr(WINDOW *win, const char *s)
 int
 addnstr(const char *str, int n)
 {
+	__CTRACE(__CTRACE_INPUT, "addnstr: n: %d, string: %s\n", n, str);
+
 	return waddnstr(stdscr, str, n);
 }
 
@@ -83,6 +89,9 @@ addnstr(const char *str, int n)
 int
 mvaddstr(int y, int x, const char *str)
 {
+	__CTRACE(__CTRACE_INPUT, "mvaddnstr: y: %d, x: %d, string: %s\n", y,
+	x, str);
+
 	return mvwaddnstr(stdscr, y, x, str, -1);
 }
 
@@ -93,6 +102,9 @@ mvaddstr(int y, int x, const char *str)
 int
 mvwaddstr(WINDOW *win, int y, int x, const char *str)
 {
+	__CTRACE(__CTRACE_INPUT, "mvwaddnstr: win: %p, y: %d, x: %d, string: %s\n",
+	win, y, x, str);
+
 	return mvwaddnstr(win, y, x, str, -1);
 }
 
@@ -104,6 +116,9 @@ mvwaddstr(WINDOW *win, int y, int x, con
 int
 mvaddnstr(int y, int x, const char *str, int count)
 {
+	__CTRACE(__CTRACE_INPUT, "mvaddnstr: n: %d, y: %d, x: %d, string: %s\n",
+	count, y, x, str);
+
 	return mvwaddnstr(stdscr, y, x, str, count);
 }
 
@@ -115,6 +130,9 @@ mvaddnstr(int y, int x, const char *str,
 int
 mvwaddnstr(WINDOW *win, int y, int x, const char *str, int count)
 {
+	__CTRACE(__CTRACE_INPUT, "mvwaddnstr: win: %p, n: %d, y: %d, x: %d, string: %s\n",
+	win, count, y, x, str);
+
 	if (wmove(win, y, x) == ERR)
 		return ERR;
 

Index: src/lib/libcurses/printw.c
diff -u src/lib/libcurses/printw.c:1.29 src/lib/libcurses/printw.c:1.30
--- src/lib/libcurses/printw.c:1.29	Sun Jun  9 07:40:14 2019
+++ src/lib/libcurses/printw.c	Wed Dec 21 06:18:01 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: printw.c,v 1.29 2019/06/09 07:40:14 blymn Exp $	*/
+/*	$NetBSD: printw.c,v 1.30 2022/12/21 06:18:01 blymn Exp $	*/
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)printw.c	8.3 (Berkeley) 5/4/94";
 #else
-__RCSID("$NetBSD: printw.c,v 1.29 2019/06/09 07:40:14 blymn Exp $");
+__RCSID("$NetBSD: printw.c,v 1.30 2022/12/21 06:18:01 blymn Exp $");
 #endif
 #endif/* not lint */
 
@@ -120,6 +120,8 @@ vw_printw(WINDOW *win, const char *fmt, 
 {
 	int n;
 
+	__CTRACE(__CTRACE_INPUT, "vw_printw: win %p\n", win);
+
 	if (win->fp == NULL) {
 		win->fp = open_memstream(>buf, >buflen);
 		if (__predict_false(win->fp == NULL))



CVS commit: src/lib/libcurses

2022-12-20 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Wed Dec 21 06:18:01 UTC 2022

Modified Files:
src/lib/libcurses: addnstr.c printw.c

Log Message:
Add more debug so a call to waddbytes can be traced to the caller.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/lib/libcurses/addnstr.c
cvs rdiff -u -r1.29 -r1.30 src/lib/libcurses/printw.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libcurses

2022-12-19 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue Dec 20 04:57:01 UTC 2022

Modified Files:
src/lib/libcurses: addbytes.c slk.c

Log Message:
Backout change to addnstr that broke other applications as n should be
the number of bytes to add - for multibyte characters n will be > 1.

Fix __slk_draw to pass in the actual length of the label instead of
the default label length because wide characters may make the
actual string length longer than the slk display length.


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/lib/libcurses/addbytes.c
cvs rdiff -u -r1.20 -r1.21 src/lib/libcurses/slk.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.67 src/lib/libcurses/addbytes.c:1.68
--- src/lib/libcurses/addbytes.c:1.67	Mon Dec 12 21:14:15 2022
+++ src/lib/libcurses/addbytes.c	Tue Dec 20 04:57:01 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: addbytes.c,v 1.67 2022/12/12 21:14:15 blymn Exp $	*/
+/*	$NetBSD: addbytes.c,v 1.68 2022/12/20 04:57:01 blymn 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.67 2022/12/12 21:14:15 blymn Exp $");
+__RCSID("$NetBSD: addbytes.c,v 1.68 2022/12/20 04:57:01 blymn Exp $");
 #endif
 #endif/* not lint */
 
@@ -118,7 +118,7 @@ _cursesi_waddbytes(WINDOW *win, const ch
 	int		*py = >cury, *px = >curx, err;
 	__LINE		*lp;
 #ifdef HAVE_WCHAR
-	int		n, width;
+	int		n;
 	cchar_t		cc;
 	wchar_t		wc;
 	mbstate_t	st;
@@ -170,18 +170,14 @@ _cursesi_waddbytes(WINDOW *win, const ch
 		}
 
 		__CTRACE(__CTRACE_INPUT,
-		"ADDBYTES WIDE(0x%x [%s], %x) at (%d, %d), ate %d bytes\n",
+		"ADDBYTES WIDE(0x%04x [%s], %x) at (%d, %d), ate %d bytes\n",
 		(unsigned)wc, unctrl((unsigned)wc), attr, *py, *px, n);
 		cc.vals[0] = wc;
 		cc.elements = 1;
 		cc.attributes = attr;
 		err = _cursesi_addwchar(win, , py, px, , char_interp);
 		bytes += n;
-
-		width = wcwidth(wc);
-		if (width < 0)
-			width = 1;
-		count -= width;
+		count -= n;
 #endif
 	}
 

Index: src/lib/libcurses/slk.c
diff -u src/lib/libcurses/slk.c:1.20 src/lib/libcurses/slk.c:1.21
--- src/lib/libcurses/slk.c:1.20	Tue Apr 12 07:03:04 2022
+++ src/lib/libcurses/slk.c	Tue Dec 20 04:57:01 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: slk.c,v 1.20 2022/04/12 07:03:04 blymn Exp $	*/
+/*	$NetBSD: slk.c,v 1.21 2022/12/20 04:57:01 blymn Exp $	*/
 
 /*-
  * Copyright (c) 2017 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #include 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: slk.c,v 1.20 2022/04/12 07:03:04 blymn Exp $");
+__RCSID("$NetBSD: slk.c,v 1.21 2022/12/20 04:57:01 blymn Exp $");
 #endif/* not lint */
 
 #include 
@@ -819,6 +819,9 @@ __slk_draw(SCREEN *screen, int labnum)
 	wchar_t wc[2];
 #endif
 
+	__CTRACE(__CTRACE_INPUT, "__slk_draw: screen %p, label %d\n", screen,
+	labnum);
+
 	if (screen->slk_hidden)
 		return OK;
 
@@ -834,7 +837,7 @@ __slk_draw(SCREEN *screen, int labnum)
 		(screen->slk_window->flags & __SCROLLOK) ||
 		((l->x + screen->slk_label_len) < screen->slk_window->maxx)) {
 			retval = mvwaddnstr(screen->slk_window, 0, l->x,
-			l->label, screen->slk_label_len);
+			l->label, strlen(l->label));
 		} else {
 			lcnt = 0;
 			tx = 0;



CVS commit: src/lib/libcurses

2022-12-19 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue Dec 20 04:57:01 UTC 2022

Modified Files:
src/lib/libcurses: addbytes.c slk.c

Log Message:
Backout change to addnstr that broke other applications as n should be
the number of bytes to add - for multibyte characters n will be > 1.

Fix __slk_draw to pass in the actual length of the label instead of
the default label length because wide characters may make the
actual string length longer than the slk display length.


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/lib/libcurses/addbytes.c
cvs rdiff -u -r1.20 -r1.21 src/lib/libcurses/slk.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libcurses

2022-12-12 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Mon Dec 12 21:14:15 UTC 2022

Modified Files:
src/lib/libcurses: addbytes.c

Log Message:
Default the character width to 1 if wcwidth fails.


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/lib/libcurses/addbytes.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libcurses

2022-12-12 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Mon Dec 12 21:14:15 UTC 2022

Modified Files:
src/lib/libcurses: addbytes.c

Log Message:
Default the character width to 1 if wcwidth fails.


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 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.66 src/lib/libcurses/addbytes.c:1.67
--- src/lib/libcurses/addbytes.c:1.66	Mon Nov  7 21:18:49 2022
+++ src/lib/libcurses/addbytes.c	Mon Dec 12 21:14:15 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: addbytes.c,v 1.66 2022/11/07 21:18:49 blymn Exp $	*/
+/*	$NetBSD: addbytes.c,v 1.67 2022/12/12 21:14:15 blymn 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.66 2022/11/07 21:18:49 blymn Exp $");
+__RCSID("$NetBSD: addbytes.c,v 1.67 2022/12/12 21:14:15 blymn Exp $");
 #endif
 #endif/* not lint */
 
@@ -118,7 +118,7 @@ _cursesi_waddbytes(WINDOW *win, const ch
 	int		*py = >cury, *px = >curx, err;
 	__LINE		*lp;
 #ifdef HAVE_WCHAR
-	int		n;
+	int		n, width;
 	cchar_t		cc;
 	wchar_t		wc;
 	mbstate_t	st;
@@ -177,7 +177,11 @@ _cursesi_waddbytes(WINDOW *win, const ch
 		cc.attributes = attr;
 		err = _cursesi_addwchar(win, , py, px, , char_interp);
 		bytes += n;
-		count -= wcwidth(wc);
+
+		width = wcwidth(wc);
+		if (width < 0)
+			width = 1;
+		count -= width;
 #endif
 	}
 



CVS commit: src/tests/lib/libcurses/check_files

2022-12-05 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Mon Dec  5 21:15:07 UTC 2022

Modified Files:
src/tests/lib/libcurses/check_files: deleteln1.chk insdelln1.chk
insertln1.chk scroll1.chk

Log Message:
Update check files due to reversion of a libcurses change.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libcurses/check_files/deleteln1.chk
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libcurses/check_files/insdelln1.chk \
src/tests/lib/libcurses/check_files/insertln1.chk \
src/tests/lib/libcurses/check_files/scroll1.chk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/check_files/deleteln1.chk
diff -u src/tests/lib/libcurses/check_files/deleteln1.chk:1.3 src/tests/lib/libcurses/check_files/deleteln1.chk:1.4
--- src/tests/lib/libcurses/check_files/deleteln1.chk:1.3	Wed Nov 30 06:20:17 2022
+++ src/tests/lib/libcurses/check_files/deleteln1.chk	Mon Dec  5 21:15:07 2022
@@ -1 +1 @@
-cup16;1X
\ No newline at end of file
+csr16;24Xhomehomecup24;1Xindn1Xcsr1;24Xhomehomecup24;1Xcup16;1X
\ No newline at end of file

Index: src/tests/lib/libcurses/check_files/insdelln1.chk
diff -u src/tests/lib/libcurses/check_files/insdelln1.chk:1.2 src/tests/lib/libcurses/check_files/insdelln1.chk:1.3
--- src/tests/lib/libcurses/check_files/insdelln1.chk:1.2	Wed Nov 30 06:20:17 2022
+++ src/tests/lib/libcurses/check_files/insdelln1.chk	Mon Dec  5 21:15:07 2022
@@ -1 +1 @@
-csr16;24Xhomehomecup16;1Xrin3Xcsr1;24Xhomehomecup24;1Xcup16;1X
\ No newline at end of file
+csr16;24Xhomehomecup16;1Xrin2Xcsr1;24Xhomehomecup24;1Xcup16;1X
\ No newline at end of file
Index: src/tests/lib/libcurses/check_files/insertln1.chk
diff -u src/tests/lib/libcurses/check_files/insertln1.chk:1.2 src/tests/lib/libcurses/check_files/insertln1.chk:1.3
--- src/tests/lib/libcurses/check_files/insertln1.chk:1.2	Wed Nov 30 06:20:17 2022
+++ src/tests/lib/libcurses/check_files/insertln1.chk	Mon Dec  5 21:15:07 2022
@@ -1 +1 @@
-csr16;24Xhomehomecup16;1Xrin2Xcsr1;24Xhomehomecup24;1Xcup16;1X
\ No newline at end of file
+csr16;24Xhomehomecup16;1Xrin1Xcsr1;24Xhomehomecup24;1Xcup16;1X
\ No newline at end of file
Index: src/tests/lib/libcurses/check_files/scroll1.chk
diff -u src/tests/lib/libcurses/check_files/scroll1.chk:1.2 src/tests/lib/libcurses/check_files/scroll1.chk:1.3
--- src/tests/lib/libcurses/check_files/scroll1.chk:1.2	Wed Nov 30 06:20:17 2022
+++ src/tests/lib/libcurses/check_files/scroll1.chk	Mon Dec  5 21:15:07 2022
@@ -1 +1 @@
-cup6;6X
\ No newline at end of file
+csr1;24Xhomehomecup24;1Xindn1Xcsr1;24Xhomehomecup24;1Xcup6;6X
\ No newline at end of file



CVS commit: src/tests/lib/libcurses/check_files

2022-12-05 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Mon Dec  5 21:15:07 UTC 2022

Modified Files:
src/tests/lib/libcurses/check_files: deleteln1.chk insdelln1.chk
insertln1.chk scroll1.chk

Log Message:
Update check files due to reversion of a libcurses change.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libcurses/check_files/deleteln1.chk
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libcurses/check_files/insdelln1.chk \
src/tests/lib/libcurses/check_files/insertln1.chk \
src/tests/lib/libcurses/check_files/scroll1.chk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libcurses

2022-12-05 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Mon Dec  5 21:14:25 UTC 2022

Modified Files:
src/lib/libcurses: refresh.c

Log Message:
Revert previous change, it is not correct.


To generate a diff of this commit:
cvs rdiff -u -r1.125 -r1.126 src/lib/libcurses/refresh.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/refresh.c
diff -u src/lib/libcurses/refresh.c:1.125 src/lib/libcurses/refresh.c:1.126
--- src/lib/libcurses/refresh.c:1.125	Wed Nov 30 06:19:15 2022
+++ src/lib/libcurses/refresh.c	Mon Dec  5 21:14:25 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: refresh.c,v 1.125 2022/11/30 06:19:15 blymn Exp $	*/
+/*	$NetBSD: refresh.c,v 1.126 2022/12/05 21:14:25 blymn Exp $	*/
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)refresh.c	8.7 (Berkeley) 8/13/94";
 #else
-__RCSID("$NetBSD: refresh.c,v 1.125 2022/11/30 06:19:15 blymn Exp $");
+__RCSID("$NetBSD: refresh.c,v 1.126 2022/12/05 21:14:25 blymn Exp $");
 #endif
 #endif/* not lint */
 
@@ -1852,13 +1852,6 @@ scrolln(int starts, int startw, int curs
 	ox = curscr->curx;
 	n = starts - startw;
 
-	if (!lineeq(__virtscr->alines[startw]->line,
-	curscr->alines[starts]->line, (size_t) __virtscr->maxx))
-		n--;
-
-	if (n == 0)
-		return;
-
 	/*
 	 * XXX
 	 * The initial tests that set __noqch don't let us reach here unless



CVS commit: src/lib/libcurses

2022-12-05 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Mon Dec  5 21:14:25 UTC 2022

Modified Files:
src/lib/libcurses: refresh.c

Log Message:
Revert previous change, it is not correct.


To generate a diff of this commit:
cvs rdiff -u -r1.125 -r1.126 src/lib/libcurses/refresh.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses/check_files

2022-11-29 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Wed Nov 30 06:20:17 UTC 2022

Modified Files:
src/tests/lib/libcurses/check_files: deleteln1.chk insdelln1.chk
insertln1.chk scroll1.chk

Log Message:
Update the check files due to bug fix in libcurses.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libcurses/check_files/deleteln1.chk
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libcurses/check_files/insdelln1.chk \
src/tests/lib/libcurses/check_files/insertln1.chk \
src/tests/lib/libcurses/check_files/scroll1.chk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/check_files/deleteln1.chk
diff -u src/tests/lib/libcurses/check_files/deleteln1.chk:1.2 src/tests/lib/libcurses/check_files/deleteln1.chk:1.3
--- src/tests/lib/libcurses/check_files/deleteln1.chk:1.2	Sat Oct 24 04:46:16 2020
+++ src/tests/lib/libcurses/check_files/deleteln1.chk	Wed Nov 30 06:20:17 2022
@@ -1 +1 @@
-csr16;24Xhomehomecup24;1Xindn1Xcsr1;24Xhomehomecup24;1Xcup16;1X
\ No newline at end of file
+cup16;1X
\ No newline at end of file

Index: src/tests/lib/libcurses/check_files/insdelln1.chk
diff -u src/tests/lib/libcurses/check_files/insdelln1.chk:1.1 src/tests/lib/libcurses/check_files/insdelln1.chk:1.2
--- src/tests/lib/libcurses/check_files/insdelln1.chk:1.1	Sat Oct 24 04:46:16 2020
+++ src/tests/lib/libcurses/check_files/insdelln1.chk	Wed Nov 30 06:20:17 2022
@@ -1 +1 @@
-csr16;24Xhomehomecup16;1Xrin2Xcsr1;24Xhomehomecup24;1Xcup16;1X
\ No newline at end of file
+csr16;24Xhomehomecup16;1Xrin3Xcsr1;24Xhomehomecup24;1Xcup16;1X
\ No newline at end of file
Index: src/tests/lib/libcurses/check_files/insertln1.chk
diff -u src/tests/lib/libcurses/check_files/insertln1.chk:1.1 src/tests/lib/libcurses/check_files/insertln1.chk:1.2
--- src/tests/lib/libcurses/check_files/insertln1.chk:1.1	Sat Oct 24 04:46:16 2020
+++ src/tests/lib/libcurses/check_files/insertln1.chk	Wed Nov 30 06:20:17 2022
@@ -1 +1 @@
-csr16;24Xhomehomecup16;1Xrin1Xcsr1;24Xhomehomecup24;1Xcup16;1X
\ No newline at end of file
+csr16;24Xhomehomecup16;1Xrin2Xcsr1;24Xhomehomecup24;1Xcup16;1X
\ No newline at end of file
Index: src/tests/lib/libcurses/check_files/scroll1.chk
diff -u src/tests/lib/libcurses/check_files/scroll1.chk:1.1 src/tests/lib/libcurses/check_files/scroll1.chk:1.2
--- src/tests/lib/libcurses/check_files/scroll1.chk:1.1	Sat Oct 24 04:46:16 2020
+++ src/tests/lib/libcurses/check_files/scroll1.chk	Wed Nov 30 06:20:17 2022
@@ -1 +1 @@
-csr1;24Xhomehomecup24;1Xindn1Xcsr1;24Xhomehomecup24;1Xcup6;6X
\ No newline at end of file
+cup6;6X
\ No newline at end of file



CVS commit: src/tests/lib/libcurses/check_files

2022-11-29 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Wed Nov 30 06:20:17 UTC 2022

Modified Files:
src/tests/lib/libcurses/check_files: deleteln1.chk insdelln1.chk
insertln1.chk scroll1.chk

Log Message:
Update the check files due to bug fix in libcurses.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libcurses/check_files/deleteln1.chk
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libcurses/check_files/insdelln1.chk \
src/tests/lib/libcurses/check_files/insertln1.chk \
src/tests/lib/libcurses/check_files/scroll1.chk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libcurses

2022-11-29 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Wed Nov 30 06:19:16 UTC 2022

Modified Files:
src/lib/libcurses: refresh.c

Log Message:
When performing a scroll, check the last line of the region is the same
on virtscr and curscr because the indexes past are supposed to be
one *past* the last matching line (they may actually match if the line is
at the bottom of the screen).  Iff they don't match reduce the scroll
region size by one so we don't scroll non-matching lines, also check
if the region is then 0 after the decrement and just return if it was.


To generate a diff of this commit:
cvs rdiff -u -r1.124 -r1.125 src/lib/libcurses/refresh.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/refresh.c
diff -u src/lib/libcurses/refresh.c:1.124 src/lib/libcurses/refresh.c:1.125
--- src/lib/libcurses/refresh.c:1.124	Wed Oct 19 06:09:27 2022
+++ src/lib/libcurses/refresh.c	Wed Nov 30 06:19:15 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: refresh.c,v 1.124 2022/10/19 06:09:27 blymn Exp $	*/
+/*	$NetBSD: refresh.c,v 1.125 2022/11/30 06:19:15 blymn Exp $	*/
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)refresh.c	8.7 (Berkeley) 8/13/94";
 #else
-__RCSID("$NetBSD: refresh.c,v 1.124 2022/10/19 06:09:27 blymn Exp $");
+__RCSID("$NetBSD: refresh.c,v 1.125 2022/11/30 06:19:15 blymn Exp $");
 #endif
 #endif/* not lint */
 
@@ -1852,6 +1852,13 @@ scrolln(int starts, int startw, int curs
 	ox = curscr->curx;
 	n = starts - startw;
 
+	if (!lineeq(__virtscr->alines[startw]->line,
+	curscr->alines[starts]->line, (size_t) __virtscr->maxx))
+		n--;
+
+	if (n == 0)
+		return;
+
 	/*
 	 * XXX
 	 * The initial tests that set __noqch don't let us reach here unless



CVS commit: src/lib/libcurses

2022-11-29 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Wed Nov 30 06:19:16 UTC 2022

Modified Files:
src/lib/libcurses: refresh.c

Log Message:
When performing a scroll, check the last line of the region is the same
on virtscr and curscr because the indexes past are supposed to be
one *past* the last matching line (they may actually match if the line is
at the bottom of the screen).  Iff they don't match reduce the scroll
region size by one so we don't scroll non-matching lines, also check
if the region is then 0 after the decrement and just return if it was.


To generate a diff of this commit:
cvs rdiff -u -r1.124 -r1.125 src/lib/libcurses/refresh.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/doc

2022-11-13 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Sun Nov 13 21:22:13 UTC 2022

Modified Files:
src/doc: CHANGES

Log Message:
Add major changes to curses(3)


To generate a diff of this commit:
cvs rdiff -u -r1.2929 -r1.2930 src/doc/CHANGES

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2929 src/doc/CHANGES:1.2930
--- src/doc/CHANGES:1.2929	Tue Nov  8 09:30:11 2022
+++ src/doc/CHANGES	Sun Nov 13 21:22:13 2022
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2929 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2930 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -573,6 +573,8 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 		in secmodel_extensions(9) [christos 20220327]
 	dhcp: Import version 4.4.3. [christos 20220402]
 	udf: Added fsck_udf(8) and upgraded newfs_udf/makefs for UDF. [reinoud 20220506]
+	curses(3); Fix colour pair handling so default color matches
+		other implementations [blymn 20220412]
 	OpenSSH: Import 9.0. [christos 20220415]
 	gpio: Allow /etc/rc.d/gpio to use a '!' character like /etc/rc.d/network
 		can to run a shell script. [brad 20220430]
@@ -711,6 +713,7 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 		recent. [mrg 20221015]
 	evbarm: Add support for Oracle Cloud virtual machines.
 		[jmcneill 20221015]
+	curses(3): Fix wide character handling and positioning [blymn 20221019]
 	date(1): Add -f option to set the time. From FreeBSD.
 		[christos 20221022]
 	tty(4), console(4): Remove the big kernel lock from ttycons.



CVS commit: src/doc

2022-11-13 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Sun Nov 13 21:22:13 UTC 2022

Modified Files:
src/doc: CHANGES

Log Message:
Add major changes to curses(3)


To generate a diff of this commit:
cvs rdiff -u -r1.2929 -r1.2930 src/doc/CHANGES

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/distrib/sets/lists/tests

2022-11-09 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Thu Nov 10 06:13:58 UTC 2022

Modified Files:
src/distrib/sets/lists/tests: mi

Log Message:
Added new libcurses test checkfile.


To generate a diff of this commit:
cvs rdiff -u -r1.1229 -r1.1230 src/distrib/sets/lists/tests/mi

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.1229 src/distrib/sets/lists/tests/mi:1.1230
--- src/distrib/sets/lists/tests/mi:1.1229	Wed Nov  9 08:21:20 2022
+++ src/distrib/sets/lists/tests/mi	Thu Nov 10 06:13:58 2022
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1229 2022/11/09 08:21:20 knakahara Exp $
+# $NetBSD: mi,v 1.1230 2022/11/10 06:13:58 blymn Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -3523,6 +3523,7 @@
 ./usr/tests/lib/libcurses/check_files/waddnwstr1.chk		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libcurses/check_files/waddnwstr2.chk		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libcurses/check_files/waddstr.chk		tests-lib-tests		compattestfile,atf
+./usr/tests/lib/libcurses/check_files/waddstr2.chk		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libcurses/check_files/waddwstr1.chk		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libcurses/check_files/waddwstr2.chk		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libcurses/check_files/waddwstr3.chk		tests-lib-tests		compattestfile,atf



CVS commit: src/distrib/sets/lists/tests

2022-11-09 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Thu Nov 10 06:13:58 UTC 2022

Modified Files:
src/distrib/sets/lists/tests: mi

Log Message:
Added new libcurses test checkfile.


To generate a diff of this commit:
cvs rdiff -u -r1.1229 -r1.1230 src/distrib/sets/lists/tests/mi

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses

2022-11-09 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Thu Nov 10 06:13:29 UTC 2022

Modified Files:
src/tests/lib/libcurses/check_files: Makefile waddstr.chk
src/tests/lib/libcurses/tests: waddstr
Added Files:
src/tests/lib/libcurses/check_files: waddstr2.chk

Log Message:
Uncomment the waddstr call that was returning ERR, this is actually
correct so make the expected return ERR then repeat the call with
scrollok set to true to validate.

Do refreshes on the window instead of stdscr so we get the window
contents reported and update the check files with the expected
output.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/tests/lib/libcurses/check_files/Makefile
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libcurses/check_files/waddstr.chk
cvs rdiff -u -r0 -r1.1 src/tests/lib/libcurses/check_files/waddstr2.chk
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libcurses/tests/waddstr

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/check_files/Makefile
diff -u src/tests/lib/libcurses/check_files/Makefile:1.11 src/tests/lib/libcurses/check_files/Makefile:1.12
--- src/tests/lib/libcurses/check_files/Makefile:1.11	Tue Nov  8 06:06:54 2022
+++ src/tests/lib/libcurses/check_files/Makefile	Thu Nov 10 06:13:29 2022
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.11 2022/11/08 06:06:54 blymn Exp $
+# $NetBSD: Makefile,v 1.12 2022/11/10 06:13:29 blymn Exp $
 
 NOMAN=		# defined
 
@@ -241,6 +241,7 @@ FILES+=		waddchstr.chk
 FILES+=		waddnwstr1.chk
 FILES+=		waddnwstr2.chk
 FILES+=		waddstr.chk
+FILES+=		waddstr2.chk
 FILES+=		waddwstr1.chk
 FILES+=		waddwstr2.chk
 FILES+=		waddwstr3.chk

Index: src/tests/lib/libcurses/check_files/waddstr.chk
diff -u src/tests/lib/libcurses/check_files/waddstr.chk:1.1 src/tests/lib/libcurses/check_files/waddstr.chk:1.2
--- src/tests/lib/libcurses/check_files/waddstr.chk:1.1	Sun Feb  7 01:53:54 2021
+++ src/tests/lib/libcurses/check_files/waddstr.chk	Thu Nov 10 06:13:29 2022
@@ -1 +1,3 @@
-home
\ No newline at end of file
+abcdecup6;8X8
+ 012345
+ 68 
\ No newline at end of file

Index: src/tests/lib/libcurses/tests/waddstr
diff -u src/tests/lib/libcurses/tests/waddstr:1.2 src/tests/lib/libcurses/tests/waddstr:1.3
--- src/tests/lib/libcurses/tests/waddstr:1.2	Sun Feb  7 01:53:54 2021
+++ src/tests/lib/libcurses/tests/waddstr	Thu Nov 10 06:13:29 2022
@@ -2,8 +2,12 @@ include window
 call OK waddstr $win1 "abcde\n"
 call OK waddstr $win1 "\n"
 call OK waddstr $win1 "\t8\n"
-# XXX: The following line causes an unexpected "ERR Resource temporarily
-# unavailable" on NetBSD/amd64 9.99.80.
-#call OK waddstr $win1 "0123456\t8\n"
-call OK refresh
+# The following should ERR because it will try to scroll but
+# scrollok is false
+call ERR waddstr $win1 "0123456\t8\n"
+call OK wrefresh $win1
 compare waddstr.chk
+call OK scrollok $win1 $TRUE
+call OK waddstr $win1 "0123456\t8\n"
+call OK wrefresh $win1
+compare waddstr2.chk

Added files:

Index: src/tests/lib/libcurses/check_files/waddstr2.chk
diff -u /dev/null src/tests/lib/libcurses/check_files/waddstr2.chk:1.1
--- /dev/null	Thu Nov 10 06:13:29 2022
+++ src/tests/lib/libcurses/check_files/waddstr2.chk	Thu Nov 10 06:13:29 2022
@@ -0,0 +1,3 @@
+012345cup5;6X6cup6;8Xel
+   8el
+ el
\ No newline at end of file



CVS commit: src/tests/lib/libcurses

2022-11-09 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Thu Nov 10 06:13:29 UTC 2022

Modified Files:
src/tests/lib/libcurses/check_files: Makefile waddstr.chk
src/tests/lib/libcurses/tests: waddstr
Added Files:
src/tests/lib/libcurses/check_files: waddstr2.chk

Log Message:
Uncomment the waddstr call that was returning ERR, this is actually
correct so make the expected return ERR then repeat the call with
scrollok set to true to validate.

Do refreshes on the window instead of stdscr so we get the window
contents reported and update the check files with the expected
output.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/tests/lib/libcurses/check_files/Makefile
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libcurses/check_files/waddstr.chk
cvs rdiff -u -r0 -r1.1 src/tests/lib/libcurses/check_files/waddstr2.chk
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libcurses/tests/waddstr

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/distrib/sets/lists/tests

2022-11-07 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue Nov  8 06:08:33 UTC 2022

Modified Files:
src/distrib/sets/lists/tests: mi

Log Message:
Added a new check file for libcurses test slk


To generate a diff of this commit:
cvs rdiff -u -r1.1227 -r1.1228 src/distrib/sets/lists/tests/mi

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.1227 src/distrib/sets/lists/tests/mi:1.1228
--- src/distrib/sets/lists/tests/mi:1.1227	Fri Nov  4 08:01:42 2022
+++ src/distrib/sets/lists/tests/mi	Tue Nov  8 06:08:33 2022
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1227 2022/11/04 08:01:42 ozaki-r Exp $
+# $NetBSD: mi,v 1.1228 2022/11/08 06:08:33 blymn Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -3504,6 +3504,7 @@
 ./usr/tests/lib/libcurses/check_files/slk4.chk			tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libcurses/check_files/slk5.chk			tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libcurses/check_files/slk6.chk			tests-lib-tests		compattestfile,atf
+./usr/tests/lib/libcurses/check_files/slk7.chk			tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libcurses/check_files/slk_init.chk		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libcurses/check_files/timeout.chk		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libcurses/check_files/touchline1.chk		tests-lib-tests		compattestfile,atf



CVS commit: src/distrib/sets/lists/tests

2022-11-07 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue Nov  8 06:08:33 UTC 2022

Modified Files:
src/distrib/sets/lists/tests: mi

Log Message:
Added a new check file for libcurses test slk


To generate a diff of this commit:
cvs rdiff -u -r1.1227 -r1.1228 src/distrib/sets/lists/tests/mi

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses

2022-11-07 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue Nov  8 06:06:54 UTC 2022

Modified Files:
src/tests/lib/libcurses/check_files: Makefile
src/tests/lib/libcurses/tests: slk
Added Files:
src/tests/lib/libcurses/check_files: slk7.chk

Log Message:
* Uncomment the slk_wset test which was previously commented out due
  to incorrect output as this bug has been fixed.
* Added a check file to verify the slk_wset output.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/tests/lib/libcurses/check_files/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/libcurses/check_files/slk7.chk
cvs rdiff -u -r1.4 -r1.5 src/tests/lib/libcurses/tests/slk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/check_files/Makefile
diff -u src/tests/lib/libcurses/check_files/Makefile:1.10 src/tests/lib/libcurses/check_files/Makefile:1.11
--- src/tests/lib/libcurses/check_files/Makefile:1.10	Wed Apr 20 07:43:05 2022
+++ src/tests/lib/libcurses/check_files/Makefile	Tue Nov  8 06:06:54 2022
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.10 2022/04/20 07:43:05 blymn Exp $
+# $NetBSD: Makefile,v 1.11 2022/11/08 06:06:54 blymn Exp $
 
 NOMAN=		# defined
 
@@ -222,6 +222,7 @@ FILES+=		slk3.chk
 FILES+=		slk4.chk
 FILES+=		slk5.chk
 FILES+=		slk6.chk
+FILES+=		slk7.chk
 FILES+=		slk_init.chk
 FILES+=		timeout.chk
 FILES+=		touchline1.chk

Index: src/tests/lib/libcurses/tests/slk
diff -u src/tests/lib/libcurses/tests/slk:1.4 src/tests/lib/libcurses/tests/slk:1.5
--- src/tests/lib/libcurses/tests/slk:1.4	Tue Jun 22 07:29:16 2021
+++ src/tests/lib/libcurses/tests/slk	Tue Nov  8 06:06:54 2022
@@ -54,7 +54,7 @@ call OK slk_refresh
 compare slk6.chk
 
 # test slk_wset
-# [buggy??] 'b' should be printed as (wcswidth(wstr) == 6) <= 8 
-#wchar WSTR [0x3401, "a", 0x3401, "b"]
-#call OK slk_wset 3 $WSTR 1
-#call OK slk_refresh
+wchar WSTR [0x3401, "a", 0x3401, "b"]
+call OK slk_wset 3 $WSTR 1
+call OK slk_refresh
+compare slk7.chk

Added files:

Index: src/tests/lib/libcurses/check_files/slk7.chk
diff -u /dev/null src/tests/lib/libcurses/check_files/slk7.chk:1.1
--- /dev/null	Tue Nov  8 06:06:54 2022
+++ src/tests/lib/libcurses/check_files/slk7.chk	Tue Nov  8 06:06:54 2022
@@ -0,0 +1 @@
+cup24;19Xsetaf1Xsetab2Xsmulrev 㐁a㐁b rmulsgr0op
\ No newline at end of file



CVS commit: src/tests/lib/libcurses

2022-11-07 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue Nov  8 06:06:54 UTC 2022

Modified Files:
src/tests/lib/libcurses/check_files: Makefile
src/tests/lib/libcurses/tests: slk
Added Files:
src/tests/lib/libcurses/check_files: slk7.chk

Log Message:
* Uncomment the slk_wset test which was previously commented out due
  to incorrect output as this bug has been fixed.
* Added a check file to verify the slk_wset output.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/tests/lib/libcurses/check_files/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/libcurses/check_files/slk7.chk
cvs rdiff -u -r1.4 -r1.5 src/tests/lib/libcurses/tests/slk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libcurses

2022-11-07 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Mon Nov  7 21:18:49 UTC 2022

Modified Files:
src/lib/libcurses: addbytes.c

Log Message:
Count character widths not number of bytes when calculating number
of characters to add.  Fixes an error detected by slk tests where
a label containing wide characters was not correctly printed.


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 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.65 src/lib/libcurses/addbytes.c:1.66
--- src/lib/libcurses/addbytes.c:1.65	Wed Oct 19 06:09:27 2022
+++ src/lib/libcurses/addbytes.c	Mon Nov  7 21:18:49 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: addbytes.c,v 1.65 2022/10/19 06:09:27 blymn Exp $	*/
+/*	$NetBSD: addbytes.c,v 1.66 2022/11/07 21:18:49 blymn 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.65 2022/10/19 06:09:27 blymn Exp $");
+__RCSID("$NetBSD: addbytes.c,v 1.66 2022/11/07 21:18:49 blymn Exp $");
 #endif
 #endif/* not lint */
 
@@ -177,7 +177,7 @@ _cursesi_waddbytes(WINDOW *win, const ch
 		cc.attributes = attr;
 		err = _cursesi_addwchar(win, , py, px, , char_interp);
 		bytes += n;
-		count -= n;
+		count -= wcwidth(wc);
 #endif
 	}
 



CVS commit: src/lib/libcurses

2022-11-07 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Mon Nov  7 21:18:49 UTC 2022

Modified Files:
src/lib/libcurses: addbytes.c

Log Message:
Count character widths not number of bytes when calculating number
of characters to add.  Fixes an error detected by slk tests where
a label containing wide characters was not correctly printed.


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/lib/libcurses/addbytes.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses/check_files

2022-11-04 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Fri Nov  4 06:17:59 UTC 2022

Modified Files:
src/tests/lib/libcurses/check_files: addstr3.chk copywin6.chk
copywin7.chk

Log Message:
Update check files to allow for changes due to fixes to libcurses.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libcurses/check_files/addstr3.chk
cvs rdiff -u -r1.4 -r1.5 src/tests/lib/libcurses/check_files/copywin6.chk \
src/tests/lib/libcurses/check_files/copywin7.chk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/check_files/addstr3.chk
diff -u src/tests/lib/libcurses/check_files/addstr3.chk:1.3 src/tests/lib/libcurses/check_files/addstr3.chk:1.4
--- src/tests/lib/libcurses/check_files/addstr3.chk:1.3	Tue Apr 12 07:04:19 2022
+++ src/tests/lib/libcurses/check_files/addstr3.chk	Fri Nov  4 06:17:58 2022
@@ -1,5 +1,2 @@
-csr2;24Xhomehome
-rin1Xcsr1;24Xhomehomecup24;1Xhome
-()cup23;1X0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*cup2;3Xclearcsr2;23Xhome
-rin1Xcsr1;24Xhomehome
-hellocup23;76Xacup2;6X
\ No newline at end of file
+0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*cup24;1X()cup24;76Xel()clearcup23;76Xa
+hello
\ No newline at end of file

Index: src/tests/lib/libcurses/check_files/copywin6.chk
diff -u src/tests/lib/libcurses/check_files/copywin6.chk:1.4 src/tests/lib/libcurses/check_files/copywin6.chk:1.5
--- src/tests/lib/libcurses/check_files/copywin6.chk:1.4	Tue Jun 22 07:49:58 2021
+++ src/tests/lib/libcurses/check_files/copywin6.chk	Fri Nov  4 06:17:58 2022
@@ -1,4 +1,4 @@
 cup3;6Xstingt
  ingtes
  gtesti
- estingcup4;6X
\ No newline at end of file
+ estingcup8;6X
\ No newline at end of file
Index: src/tests/lib/libcurses/check_files/copywin7.chk
diff -u src/tests/lib/libcurses/check_files/copywin7.chk:1.4 src/tests/lib/libcurses/check_files/copywin7.chk:1.5
--- src/tests/lib/libcurses/check_files/copywin7.chk:1.4	Tue Jun 22 07:49:58 2021
+++ src/tests/lib/libcurses/check_files/copywin7.chk	Fri Nov  4 06:17:58 2022
@@ -1,4 +1,4 @@
-el
+el
  el
  el
  elcup11;15Xelcup12;15Xelcup13;15Xelcup14;15Xelcup15;15Xelcup17;15Xel
\ No newline at end of file



CVS commit: src/tests/lib/libcurses/check_files

2022-11-04 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Fri Nov  4 06:17:59 UTC 2022

Modified Files:
src/tests/lib/libcurses/check_files: addstr3.chk copywin6.chk
copywin7.chk

Log Message:
Update check files to allow for changes due to fixes to libcurses.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libcurses/check_files/addstr3.chk
cvs rdiff -u -r1.4 -r1.5 src/tests/lib/libcurses/check_files/copywin6.chk \
src/tests/lib/libcurses/check_files/copywin7.chk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libcurses

2022-11-04 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Fri Nov  4 06:12:23 UTC 2022

Modified Files:
src/lib/libcurses: move.c

Log Message:
PR bin/57072

This fixes observed behviour in the PR.  Allow the cursor to be
moved one past the EOL, if postitioned here then set ISPASTEOL.
also protect out of range access if win->cury is past maxy.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/lib/libcurses/move.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/move.c
diff -u src/lib/libcurses/move.c:1.24 src/lib/libcurses/move.c:1.25
--- src/lib/libcurses/move.c:1.24	Wed Apr 27 22:04:04 2022
+++ src/lib/libcurses/move.c	Fri Nov  4 06:12:22 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: move.c,v 1.24 2022/04/27 22:04:04 blymn Exp $	*/
+/*	$NetBSD: move.c,v 1.25 2022/11/04 06:12:22 blymn Exp $	*/
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)move.c	8.2 (Berkeley) 5/4/94";
 #else
-__RCSID("$NetBSD: move.c,v 1.24 2022/04/27 22:04:04 blymn Exp $");
+__RCSID("$NetBSD: move.c,v 1.25 2022/11/04 06:12:22 blymn Exp $");
 #endif
 #endif/* not lint */
 
@@ -65,13 +65,17 @@ wmove(WINDOW *win, int y, int x)
 	__CTRACE(__CTRACE_MISC, "wmove: win %p, (%d, %d)\n", win, y, x);
 	if (x < 0 || y < 0)
 		return ERR;
-	if (x >= win->maxx || y >= win->maxy)
+	if (x > win->maxx || y >= win->maxy)
 		return ERR;
 
 	/* clear the EOL flags for both where we were and where we are going */
-	win->alines[win->cury]->flags &= ~ __ISPASTEOL;
+	if (win->cury < win->maxy)
+		win->alines[win->cury]->flags &= ~ __ISPASTEOL;
 	win->alines[y]->flags &= ~ __ISPASTEOL;
 
+	if (x == win->maxx)
+		win->alines[y]->flags |= __ISPASTEOL;
+
 	win->curx = x;
 	win->cury = y;
 



CVS commit: src/lib/libcurses

2022-11-04 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Fri Nov  4 06:12:23 UTC 2022

Modified Files:
src/lib/libcurses: move.c

Log Message:
PR bin/57072

This fixes observed behviour in the PR.  Allow the cursor to be
moved one past the EOL, if postitioned here then set ISPASTEOL.
also protect out of range access if win->cury is past maxy.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/lib/libcurses/move.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libcurses

2022-10-25 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue Oct 25 06:20:01 UTC 2022

Modified Files:
src/lib/libcurses: attributes.c

Log Message:
Fix for lib/57050
Perform a sanity check on the window parameter being passed and return
ERR if it is null.  This prevents buggy code crashing.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/lib/libcurses/attributes.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/attributes.c
diff -u src/lib/libcurses/attributes.c:1.34 src/lib/libcurses/attributes.c:1.35
--- src/lib/libcurses/attributes.c:1.34	Tue Apr 12 07:03:04 2022
+++ src/lib/libcurses/attributes.c	Tue Oct 25 06:20:01 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: attributes.c,v 1.34 2022/04/12 07:03:04 blymn Exp $	*/
+/*	$NetBSD: attributes.c,v 1.35 2022/10/25 06:20:01 blymn Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: attributes.c,v 1.34 2022/04/12 07:03:04 blymn Exp $");
+__RCSID("$NetBSD: attributes.c,v 1.35 2022/10/25 06:20:01 blymn Exp $");
 #endif/* not lint */
 
 #include "curses.h"
@@ -143,6 +143,9 @@ attrset(int attr)
 int
 wattr_get(WINDOW *win, attr_t *attr, short *pair, void *opts)
 {
+	if (__predict_false(win == NULL))
+		return ERR;
+
 	__CTRACE(__CTRACE_ATTR, "wattr_get: win %p\n", win);
 	if (attr != NULL) {
 		*attr = win->wattr;
@@ -231,6 +234,9 @@ wcolor_set(WINDOW *win, short pair, void
 chtype
 getattrs(WINDOW *win)
 {
+	if (__predict_false(win == NULL))
+		return ERR;
+
 	__CTRACE(__CTRACE_ATTR, "getattrs: win %p\n", win);
 	return((chtype) win->wattr);
 }
@@ -361,7 +367,12 @@ term_attrs(void)
 static int
 __wattr_on(WINDOW *win, attr_t attr)
 {
-	const TERMINAL *t = win->screen->term;
+	const TERMINAL *t;
+
+	if (__predict_false(win == NULL))
+		return ERR;
+
+	t = win->screen->term;
 
 	__CTRACE(__CTRACE_ATTR, "wattr_on: win %p, attr %08x\n", win, attr);
 	/* If can enter modes, set the relevant attribute bits. */
@@ -408,7 +419,12 @@ __wattr_on(WINDOW *win, attr_t attr)
 static int
 __wattr_off(WINDOW *win, attr_t attr)
 {
-	const TERMINAL *t = win->screen->term;
+	const TERMINAL *t;
+
+	if (__predict_false(win == NULL))
+		return ERR;
+
+	t = win->screen->term;
 
 	__CTRACE(__CTRACE_ATTR, "wattr_off: win %p, attr %08x\n", win, attr);
 	/* If can do exit modes, unset the relevant attribute bits. */
@@ -455,7 +471,12 @@ __wattr_off(WINDOW *win, attr_t attr)
 static void
 __wcolor_set(WINDOW *win, attr_t attr)
 {
-	const TERMINAL *t = win->screen->term;
+	const TERMINAL *t;
+
+	if (__predict_false(win == NULL))
+		return;
+
+	t = win->screen->term;
 
 	/* If another color pair is set, turn that off first. */
 	win->wattr &= ~__COLOR;



CVS commit: src/lib/libcurses

2022-10-25 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue Oct 25 06:20:01 UTC 2022

Modified Files:
src/lib/libcurses: attributes.c

Log Message:
Fix for lib/57050
Perform a sanity check on the window parameter being passed and return
ERR if it is null.  This prevents buggy code crashing.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/lib/libcurses/attributes.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses

2022-10-19 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Wed Oct 19 06:10:44 UTC 2022

Modified Files:
src/tests/lib/libcurses/check_files: add_wch3.chk copywin10.chk
delch2.chk delch3.chk delch6.chk delch7.chk get_wstr.chk
getn_wstr.chk ins_wch2.chk ins_wch3.chk redrawwin2.chk
touchline2.chk wcolor_set.chk wget_wstr.chk wgetn_wstr.chk
wins_wch2.chk wins_wch3.chk wins_wstr4.chk wvline_set.chk
src/tests/lib/libcurses/tests: ins_wch

Log Message:
Updates to account for changes resulting from fixes to libcurses.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libcurses/check_files/add_wch3.chk \
src/tests/lib/libcurses/check_files/delch3.chk \
src/tests/lib/libcurses/check_files/get_wstr.chk \
src/tests/lib/libcurses/check_files/getn_wstr.chk \
src/tests/lib/libcurses/check_files/ins_wch2.chk \
src/tests/lib/libcurses/check_files/ins_wch3.chk \
src/tests/lib/libcurses/check_files/wcolor_set.chk \
src/tests/lib/libcurses/check_files/wget_wstr.chk \
src/tests/lib/libcurses/check_files/wgetn_wstr.chk \
src/tests/lib/libcurses/check_files/wins_wch2.chk \
src/tests/lib/libcurses/check_files/wvline_set.chk
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libcurses/check_files/copywin10.chk \
src/tests/lib/libcurses/check_files/wins_wch3.chk
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libcurses/check_files/delch2.chk \
src/tests/lib/libcurses/check_files/delch6.chk \
src/tests/lib/libcurses/check_files/delch7.chk \
src/tests/lib/libcurses/check_files/redrawwin2.chk \
src/tests/lib/libcurses/check_files/touchline2.chk \
src/tests/lib/libcurses/check_files/wins_wstr4.chk
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libcurses/tests/ins_wch

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/check_files/add_wch3.chk
diff -u src/tests/lib/libcurses/check_files/add_wch3.chk:1.2 src/tests/lib/libcurses/check_files/add_wch3.chk:1.3
--- src/tests/lib/libcurses/check_files/add_wch3.chk:1.2	Tue Jan 25 03:23:05 2022
+++ src/tests/lib/libcurses/check_files/add_wch3.chk	Wed Oct 19 06:10:43 2022
@@ -1,2 +1,2 @@
 smso㐁rmsohome
-㐁㐁 
\ No newline at end of file
+
\ No newline at end of file
Index: src/tests/lib/libcurses/check_files/delch3.chk
diff -u src/tests/lib/libcurses/check_files/delch3.chk:1.2 src/tests/lib/libcurses/check_files/delch3.chk:1.3
--- src/tests/lib/libcurses/check_files/delch3.chk:1.2	Sat Oct 24 04:46:16 2020
+++ src/tests/lib/libcurses/check_files/delch3.chk	Wed Oct 19 06:10:43 2022
@@ -1 +1 @@
-stsmsotrmso  tessmsotrmso   tes
\ No newline at end of file
+stsmsotrmso  tessmsotelrmso
\ No newline at end of file
Index: src/tests/lib/libcurses/check_files/get_wstr.chk
diff -u src/tests/lib/libcurses/check_files/get_wstr.chk:1.2 src/tests/lib/libcurses/check_files/get_wstr.chk:1.3
--- src/tests/lib/libcurses/check_files/get_wstr.chk:1.2	Tue Jan 25 03:23:05 2022
+++ src/tests/lib/libcurses/check_files/get_wstr.chk	Wed Oct 19 06:10:43 2022
@@ -1,6 +1,6 @@
 
 
㐁el
-a   cup4;2Xab  cup4;3Xcup4;1Xc   cup4;2Xcd  cup4;3Xcde cup4;4Xcd  cup4;3Xcdf cup4;4X
-a   cup5;6Xab  cup5;7Xa   cup5;6Xac  cup5;7Xacd cup5;8Xacdcup5;9XacdO   cup5;10XacdOD  cup5;11Xsmkx
-  a  cup6;3X ab cup6;4X abccup6;5Xel  d  cup6;3X
\ No newline at end of file
+aelabelelcelcdelcdeelcdelcdfel
+ael   

CVS commit: src/tests/lib/libcurses

2022-10-19 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Wed Oct 19 06:10:44 UTC 2022

Modified Files:
src/tests/lib/libcurses/check_files: add_wch3.chk copywin10.chk
delch2.chk delch3.chk delch6.chk delch7.chk get_wstr.chk
getn_wstr.chk ins_wch2.chk ins_wch3.chk redrawwin2.chk
touchline2.chk wcolor_set.chk wget_wstr.chk wgetn_wstr.chk
wins_wch2.chk wins_wch3.chk wins_wstr4.chk wvline_set.chk
src/tests/lib/libcurses/tests: ins_wch

Log Message:
Updates to account for changes resulting from fixes to libcurses.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libcurses/check_files/add_wch3.chk \
src/tests/lib/libcurses/check_files/delch3.chk \
src/tests/lib/libcurses/check_files/get_wstr.chk \
src/tests/lib/libcurses/check_files/getn_wstr.chk \
src/tests/lib/libcurses/check_files/ins_wch2.chk \
src/tests/lib/libcurses/check_files/ins_wch3.chk \
src/tests/lib/libcurses/check_files/wcolor_set.chk \
src/tests/lib/libcurses/check_files/wget_wstr.chk \
src/tests/lib/libcurses/check_files/wgetn_wstr.chk \
src/tests/lib/libcurses/check_files/wins_wch2.chk \
src/tests/lib/libcurses/check_files/wvline_set.chk
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libcurses/check_files/copywin10.chk \
src/tests/lib/libcurses/check_files/wins_wch3.chk
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libcurses/check_files/delch2.chk \
src/tests/lib/libcurses/check_files/delch6.chk \
src/tests/lib/libcurses/check_files/delch7.chk \
src/tests/lib/libcurses/check_files/redrawwin2.chk \
src/tests/lib/libcurses/check_files/touchline2.chk \
src/tests/lib/libcurses/check_files/wins_wstr4.chk
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libcurses/tests/ins_wch

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libcurses

2022-10-19 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Wed Oct 19 06:09:27 UTC 2022

Modified Files:
src/lib/libcurses: add_wchstr.c addbytes.c background.c chgat.c
clrtobot.c color.c cr_put.c curses.c delch.c erase.c ins_wch.c
ins_wstr.c insch.c insdelln.c insstr.c refresh.c resize.c

Log Message:
Fixes for lib/56926 amongst other things:
 - plod now correctly accounts for wide characters when plodding
 - use erase line when in color mode if the terminal has the capability
 - ensure that the CA_CONTINUATION flag is applied consistently to the
   subsequent characters in a wide character.
 - fix a bunch of refresh bugs that caused inconsistent placement of
   wide characters.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/lib/libcurses/add_wchstr.c
cvs rdiff -u -r1.64 -r1.65 src/lib/libcurses/addbytes.c
cvs rdiff -u -r1.32 -r1.33 src/lib/libcurses/background.c
cvs rdiff -u -r1.8 -r1.9 src/lib/libcurses/chgat.c
cvs rdiff -u -r1.30 -r1.31 src/lib/libcurses/clrtobot.c \
src/lib/libcurses/curses.c
cvs rdiff -u -r1.46 -r1.47 src/lib/libcurses/color.c
cvs rdiff -u -r1.39 -r1.40 src/lib/libcurses/cr_put.c
cvs rdiff -u -r1.29 -r1.30 src/lib/libcurses/delch.c
cvs rdiff -u -r1.36 -r1.37 src/lib/libcurses/erase.c
cvs rdiff -u -r1.19 -r1.20 src/lib/libcurses/ins_wch.c
cvs rdiff -u -r1.23 -r1.24 src/lib/libcurses/ins_wstr.c
cvs rdiff -u -r1.27 -r1.28 src/lib/libcurses/insch.c
cvs rdiff -u -r1.22 -r1.23 src/lib/libcurses/insdelln.c
cvs rdiff -u -r1.10 -r1.11 src/lib/libcurses/insstr.c
cvs rdiff -u -r1.123 -r1.124 src/lib/libcurses/refresh.c
cvs rdiff -u -r1.35 -r1.36 src/lib/libcurses/resize.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libcurses

2022-10-19 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Wed Oct 19 06:09:27 UTC 2022

Modified Files:
src/lib/libcurses: add_wchstr.c addbytes.c background.c chgat.c
clrtobot.c color.c cr_put.c curses.c delch.c erase.c ins_wch.c
ins_wstr.c insch.c insdelln.c insstr.c refresh.c resize.c

Log Message:
Fixes for lib/56926 amongst other things:
 - plod now correctly accounts for wide characters when plodding
 - use erase line when in color mode if the terminal has the capability
 - ensure that the CA_CONTINUATION flag is applied consistently to the
   subsequent characters in a wide character.
 - fix a bunch of refresh bugs that caused inconsistent placement of
   wide characters.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/lib/libcurses/add_wchstr.c
cvs rdiff -u -r1.64 -r1.65 src/lib/libcurses/addbytes.c
cvs rdiff -u -r1.32 -r1.33 src/lib/libcurses/background.c
cvs rdiff -u -r1.8 -r1.9 src/lib/libcurses/chgat.c
cvs rdiff -u -r1.30 -r1.31 src/lib/libcurses/clrtobot.c \
src/lib/libcurses/curses.c
cvs rdiff -u -r1.46 -r1.47 src/lib/libcurses/color.c
cvs rdiff -u -r1.39 -r1.40 src/lib/libcurses/cr_put.c
cvs rdiff -u -r1.29 -r1.30 src/lib/libcurses/delch.c
cvs rdiff -u -r1.36 -r1.37 src/lib/libcurses/erase.c
cvs rdiff -u -r1.19 -r1.20 src/lib/libcurses/ins_wch.c
cvs rdiff -u -r1.23 -r1.24 src/lib/libcurses/ins_wstr.c
cvs rdiff -u -r1.27 -r1.28 src/lib/libcurses/insch.c
cvs rdiff -u -r1.22 -r1.23 src/lib/libcurses/insdelln.c
cvs rdiff -u -r1.10 -r1.11 src/lib/libcurses/insstr.c
cvs rdiff -u -r1.123 -r1.124 src/lib/libcurses/refresh.c
cvs rdiff -u -r1.35 -r1.36 src/lib/libcurses/resize.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/add_wchstr.c
diff -u src/lib/libcurses/add_wchstr.c:1.13 src/lib/libcurses/add_wchstr.c:1.14
--- src/lib/libcurses/add_wchstr.c:1.13	Tue May  3 07:25:34 2022
+++ src/lib/libcurses/add_wchstr.c	Wed Oct 19 06:09:27 2022
@@ -1,4 +1,4 @@
-/*   $NetBSD: add_wchstr.c,v 1.13 2022/05/03 07:25:34 blymn Exp $ */
+/*   $NetBSD: add_wchstr.c,v 1.14 2022/10/19 06:09:27 blymn Exp $ */
 
 /*
  * Copyright (c) 2005 The NetBSD Foundation Inc.
@@ -36,7 +36,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: add_wchstr.c,v 1.13 2022/05/03 07:25:34 blymn Exp $");
+__RCSID("$NetBSD: add_wchstr.c,v 1.14 2022/10/19 06:09:27 blymn Exp $");
 #endif/* not lint */
 
 #include 
@@ -174,7 +174,8 @@ wadd_wchnstr(WINDOW *win, const cchar_t 
 if (_cursesi_copy_nsp(win->bnsp, tp) == ERR)
 	return ERR;
 tp->attr = win->battr;
-(*tp).wcols = 1;
+tp->wcols = 1;
+tp->cflags = CA_BACKGROUND;
 np = tp->nsp;
 			}
 		} else {
@@ -186,7 +187,7 @@ wadd_wchnstr(WINDOW *win, const cchar_t 
 	}
 	lnp->flags |= __ISDIRTY;
 	newx = sx + win->ch_off;
-	if (newx < *lnp->firstchp)
+	if (newx < *lnp->firstchp) 
 		*lnp->firstchp = newx;
 
 	/* add characters in the string */
@@ -210,7 +211,7 @@ wadd_wchnstr(WINDOW *win, const cchar_t 
 	== ERR)
 		return ERR;
 	lp->attr = win->battr;
-	lp->cflags |= CA_BACKGROUND;
+	lp->cflags = CA_BACKGROUND;
 	(*lp).wcols = 1;
 	lp++, ex++;
 }
@@ -259,6 +260,8 @@ wadd_wchnstr(WINDOW *win, const cchar_t 
 }
 lp->ch = chp->vals[0];
 lp->attr = chp->attributes & WA_ATTRIBUTES;
+lp->cflags &= ~CA_BACKGROUND;
+lp->cflags |= CA_CONTINUATION;
 (*lp).wcols = x - ex;
 lp++, ex++;
 			}

Index: src/lib/libcurses/addbytes.c
diff -u src/lib/libcurses/addbytes.c:1.64 src/lib/libcurses/addbytes.c:1.65
--- src/lib/libcurses/addbytes.c:1.64	Thu May 19 07:41:26 2022
+++ src/lib/libcurses/addbytes.c	Wed Oct 19 06:09:27 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: addbytes.c,v 1.64 2022/05/19 07:41:26 blymn Exp $	*/
+/*	$NetBSD: addbytes.c,v 1.65 2022/10/19 06:09:27 blymn 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.64 2022/05/19 07:41:26 blymn Exp $");
+__RCSID("$NetBSD: addbytes.c,v 1.65 2022/10/19 06:09:27 blymn Exp $");
 #endif
 #endif/* not lint */
 
@@ -293,6 +293,7 @@ _cursesi_addbyte(WINDOW *win, __LINE **l
 	 */
 	if (newx < *(*lp)->firstchp)
 		*(*lp)->firstchp = newx;
+
 	if (newx > *(*lp)->lastchp)
 		*(*lp)->lastchp = newx;
 	__CTRACE(__CTRACE_INPUT, "ADDBYTES: change gives f/l: %d/%d [%d/%d]\n",
@@ -311,7 +312,7 @@ _cursesi_addbyte(WINDOW *win, __LINE **l
 #endif
 	}
 
-	(*lp)->line[*x].cflags &= ~ CA_BACKGROUND;
+	(*lp)->line[*x].cflags &= ~ (CA_BACKGROUND | CA_CONTINUATION);
 
 	if (attributes & __COLOR)
 		(*lp)->line[*x].attr =
@@ -421,6 +422,7 @@ _cursesi_addwchar(WINDOW *win, __LINE **
 		newx = *x + win->ch_off;
 		if (newx < *(*lnp)->firstchp)
 			*(*lnp)->firstchp = newx;
+
 		if (newx > *(*lnp)->lastchp)
 			*(*lnp)->lastchp = newx;
 		__touchline(win, *y, *x, *x);
@@ -451,7 +453,7 @@ _cursesi_addwchar(WINDOW 

CVS commit: src/lib/libcurses

2022-05-19 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Thu May 19 07:41:26 UTC 2022

Modified Files:
src/lib/libcurses: addbytes.c

Log Message:
Set the last change pointer after adding a character at the bottom right
of a window.  This fixes the character missing in the LR of a window.
Thanks to uwe@ for pointing this out.


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/lib/libcurses/addbytes.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libcurses

2022-05-19 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Thu May 19 07:41:26 UTC 2022

Modified Files:
src/lib/libcurses: addbytes.c

Log Message:
Set the last change pointer after adding a character at the bottom right
of a window.  This fixes the character missing in the LR of a window.
Thanks to uwe@ for pointing this out.


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 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.63 src/lib/libcurses/addbytes.c:1.64
--- src/lib/libcurses/addbytes.c:1.63	Tue May  3 07:25:34 2022
+++ src/lib/libcurses/addbytes.c	Thu May 19 07:41:26 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: addbytes.c,v 1.63 2022/05/03 07:25:34 blymn Exp $	*/
+/*	$NetBSD: addbytes.c,v 1.64 2022/05/19 07:41:26 blymn 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.63 2022/05/03 07:25:34 blymn Exp $");
+__RCSID("$NetBSD: addbytes.c,v 1.64 2022/05/19 07:41:26 blymn Exp $");
 #endif
 #endif/* not lint */
 
@@ -588,6 +588,7 @@ _cursesi_addwchar(WINDOW *win, __LINE **
 		}
 		lp = >alines[*y]->line[0];
 		(*lnp) = win->alines[*y];
+		*(*lnp)->lastchp = win->ch_off + win->maxx - 1;
 	} else {
 
 		/* clear the remaining of the current character */



CVS commit: src/lib/libcurses

2022-05-12 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Thu May 12 22:25:38 UTC 2022

Modified Files:
src/lib/libcurses: clrtoeol.c

Log Message:
Make clrtoeol match the ncurses behaviour where it seems to make the
rest of line foreground.  This fixes a display oddity in mutt.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 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/clrtoeol.c
diff -u src/lib/libcurses/clrtoeol.c:1.34 src/lib/libcurses/clrtoeol.c:1.35
--- src/lib/libcurses/clrtoeol.c:1.34	Tue Apr 12 07:03:04 2022
+++ src/lib/libcurses/clrtoeol.c	Thu May 12 22:25:38 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: clrtoeol.c,v 1.34 2022/04/12 07:03:04 blymn Exp $	*/
+/*	$NetBSD: clrtoeol.c,v 1.35 2022/05/12 22:25:38 blymn 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.34 2022/04/12 07:03:04 blymn Exp $");
+__RCSID("$NetBSD: clrtoeol.c,v 1.35 2022/05/12 22:25:38 blymn Exp $");
 #endif
 #endif/* not lint */
 
@@ -91,6 +91,12 @@ wclrtoeol(WINDOW *win)
 	maxx = >alines[y]->line[x];
 
 	for (sp = maxx; sp < end; sp++) {
+		/*
+		 * It looks like ncurses makes the rest of line foreground
+		 * when it is cleared - this doesn't seem right but it
+		 * makes applicatins look right.
+		 */
+		sp->cflags &= ~CA_BACKGROUND;
 		if (!(__NEED_ERASE(sp, bch, battr)))
 			continue;
 



CVS commit: src/lib/libcurses

2022-05-12 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Thu May 12 22:25:38 UTC 2022

Modified Files:
src/lib/libcurses: clrtoeol.c

Log Message:
Make clrtoeol match the ncurses behaviour where it seems to make the
rest of line foreground.  This fixes a display oddity in mutt.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/lib/libcurses/clrtoeol.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libcurses

2022-05-05 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Thu May  5 22:02:17 UTC 2022

Modified Files:
src/lib/libcurses: background.c

Log Message:
Don't force the refresh, it doesn't really need it.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/lib/libcurses/background.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libcurses

2022-05-05 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Thu May  5 22:02:17 UTC 2022

Modified Files:
src/lib/libcurses: background.c

Log Message:
Don't force the refresh, it doesn't really need it.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/lib/libcurses/background.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/background.c
diff -u src/lib/libcurses/background.c:1.31 src/lib/libcurses/background.c:1.32
--- src/lib/libcurses/background.c:1.31	Tue May  3 07:25:34 2022
+++ src/lib/libcurses/background.c	Thu May  5 22:02:17 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: background.c,v 1.31 2022/05/03 07:25:34 blymn Exp $	*/
+/*	$NetBSD: background.c,v 1.32 2022/05/05 22:02:17 blymn Exp $	*/
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: background.c,v 1.31 2022/05/03 07:25:34 blymn Exp $");
+__RCSID("$NetBSD: background.c,v 1.32 2022/05/05 22:02:17 blymn Exp $");
 #endif/* not lint */
 
 #include 
@@ -245,7 +245,7 @@ wbkgrndset(WINDOW *win, const cchar_t *w
 			}
 		}
 	}
-	__touchwin(win, 1);
+	__touchwin(win, 0);
 
 }
 



CVS commit: src/tests/lib/libcurses

2022-05-03 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue May  3 22:18:16 UTC 2022

Modified Files:
src/tests/lib/libcurses: t_curses.sh
src/tests/lib/libcurses/tests: mutt_test

Log Message:
Add mutt_test to the test runs, this test tries to emulate a real
curses application to test the interaction of various curses calls.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/tests/lib/libcurses/t_curses.sh
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libcurses/tests/mutt_test

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses

2022-05-03 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue May  3 22:18:16 UTC 2022

Modified Files:
src/tests/lib/libcurses: t_curses.sh
src/tests/lib/libcurses/tests: mutt_test

Log Message:
Add mutt_test to the test runs, this test tries to emulate a real
curses application to test the interaction of various curses calls.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/tests/lib/libcurses/t_curses.sh
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libcurses/tests/mutt_test

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/t_curses.sh
diff -u src/tests/lib/libcurses/t_curses.sh:1.31 src/tests/lib/libcurses/t_curses.sh:1.32
--- src/tests/lib/libcurses/t_curses.sh:1.31	Tue Apr 26 22:48:36 2022
+++ src/tests/lib/libcurses/t_curses.sh	Tue May  3 22:18:16 2022
@@ -2187,6 +2187,20 @@ wunderscore_body()
 	h_run wunderscore
 }
 
+##
+# Simulate curses application behaviour
+##
+
+atf_test_case mutt_test
+mutt_test_head()
+{
+	atf_set "descr" "Try to emulate a curses application"
+}
+mutt_test_body()
+{
+	h_run mutt_test
+}
+
 atf_init_test_cases()
 {
 	# testframe utility functions
@@ -2444,4 +2458,7 @@ atf_init_test_cases()
 	# curses underscore attribute manipulation routines
 	atf_add_test_case underscore
 	atf_add_test_case wunderscore
+
+	# emulate a curses application
+	atf_add_test_case mutt_test
 }

Index: src/tests/lib/libcurses/tests/mutt_test
diff -u src/tests/lib/libcurses/tests/mutt_test:1.2 src/tests/lib/libcurses/tests/mutt_test:1.3
--- src/tests/lib/libcurses/tests/mutt_test:1.2	Thu Sep 19 11:31:58 2019
+++ src/tests/lib/libcurses/tests/mutt_test	Tue May  3 22:18:16 2022
@@ -1,3 +1,8 @@
+#
+# This test attempts to emulate some of the behaviours of mutt, it is neither
+# an exact nor complete emulation of what mutt does but it does test the
+# interaction of various call types.
+#
 include start_color
 include fill_screen
 comparend mutt_test1.chk



CVS commit: src/tests/lib/libcurses/check_files

2022-05-03 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue May  3 22:01:13 UTC 2022

Modified Files:
src/tests/lib/libcurses/check_files: mutt_test1.chk mutt_test3.chk
mutt_test4.chk mutt_test5.chk mutt_test6.chk mutt_test8.chk
mutt_test9.chk

Log Message:
Update check files, changes due to bug fixes.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libcurses/check_files/mutt_test1.chk \
src/tests/lib/libcurses/check_files/mutt_test3.chk \
src/tests/lib/libcurses/check_files/mutt_test8.chk \
src/tests/lib/libcurses/check_files/mutt_test9.chk
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libcurses/check_files/mutt_test4.chk \
src/tests/lib/libcurses/check_files/mutt_test5.chk \
src/tests/lib/libcurses/check_files/mutt_test6.chk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses/check_files

2022-05-03 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue May  3 22:01:13 UTC 2022

Modified Files:
src/tests/lib/libcurses/check_files: mutt_test1.chk mutt_test3.chk
mutt_test4.chk mutt_test5.chk mutt_test6.chk mutt_test8.chk
mutt_test9.chk

Log Message:
Update check files, changes due to bug fixes.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libcurses/check_files/mutt_test1.chk \
src/tests/lib/libcurses/check_files/mutt_test3.chk \
src/tests/lib/libcurses/check_files/mutt_test8.chk \
src/tests/lib/libcurses/check_files/mutt_test9.chk
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libcurses/check_files/mutt_test4.chk \
src/tests/lib/libcurses/check_files/mutt_test5.chk \
src/tests/lib/libcurses/check_files/mutt_test6.chk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/check_files/mutt_test1.chk
diff -u src/tests/lib/libcurses/check_files/mutt_test1.chk:1.1 src/tests/lib/libcurses/check_files/mutt_test1.chk:1.2
--- src/tests/lib/libcurses/check_files/mutt_test1.chk:1.1	Sun May 26 09:54:33 2019
+++ src/tests/lib/libcurses/check_files/mutt_test1.chk	Tue May  3 22:01:13 2022
@@ -1 +0,0 @@
-setaf7Xsetab0X
\ No newline at end of file
Index: src/tests/lib/libcurses/check_files/mutt_test3.chk
diff -u src/tests/lib/libcurses/check_files/mutt_test3.chk:1.1 src/tests/lib/libcurses/check_files/mutt_test3.chk:1.2
--- src/tests/lib/libcurses/check_files/mutt_test3.chk:1.1	Sun May 26 09:54:33 2019
+++ src/tests/lib/libcurses/check_files/mutt_test3.chk	Tue May  3 22:01:13 2022
@@ -1 +1 @@
-homesetaf7Xsetab0Xboldcup13;1Xcup23;1Xsgr0op
\ No newline at end of file
+homeboldcup13;1Xcup23;1Xsgr0op
\ No newline at end of file
Index: src/tests/lib/libcurses/check_files/mutt_test8.chk
diff -u src/tests/lib/libcurses/check_files/mutt_test8.chk:1.1 src/tests/lib/libcurses/check_files/mutt_test8.chk:1.2
--- src/tests/lib/libcurses/check_files/mutt_test8.chk:1.1	Sun May 26 09:54:33 2019
+++ src/tests/lib/libcurses/check_files/mutt_test8.chk	Tue May  3 22:01:13 2022
@@ -1 +1 @@
-smkxopsetaf7Xsetab0Xcup13;73Xcup14;1Xboldcup15;1Xsgr0opsetaf7Xsetab0Xcup15;1Xboldcup16;1Xsgr0opsetaf7Xsetab0Xcup16;1Xboldcup16;73Xcup17;1Xsgr0op
\ No newline at end of file
+smkxopcup13;73Xcup14;1Xboldcup15;1Xsgr0opcup15;1Xboldcup16;1Xsgr0opcup16;1Xboldcup16;73Xcup17;1Xsgr0op
\ No newline at end of file
Index: src/tests/lib/libcurses/check_files/mutt_test9.chk
diff -u src/tests/lib/libcurses/check_files/mutt_test9.chk:1.1 src/tests/lib/libcurses/check_files/mutt_test9.chk:1.2
--- src/tests/lib/libcurses/check_files/mutt_test9.chk:1.1	Sun May 26 09:54:33 2019
+++ src/tests/lib/libcurses/check_files/mutt_test9.chk	Tue May  3 22:01:13 2022
@@ -1 +1 @@
-cup15;11Xsetaf7Xsetab0XsmsoRRRcup24;1Xrmsoopopcup15;15Xsetaf7Xsetab0XHHHopop
\ No newline at end of file
+cup15;11XsmsoRRRcup24;1Xrmsoopopcup15;15XHHHopop
\ No newline at end of file

Index: src/tests/lib/libcurses/check_files/mutt_test4.chk
diff -u src/tests/lib/libcurses/check_files/mutt_test4.chk:1.2 src/tests/lib/libcurses/check_files/mutt_test4.chk:1.3
--- src/tests/lib/libcurses/check_files/mutt_test4.chk:1.2	Sun Jun  9 07:49:42 2019
+++ src/tests/lib/libcurses/check_files/mutt_test4.chk	Tue May  3 22:01:13 2022
@@ -1,2 +1,2 @@
 
-setaf7Xsetab0Xrev123456789sgr0opsetaf7Xsetab0Xiop
\ No newline at end of file
+rev123456789sgr0opiop
\ No newline at end of file
Index: src/tests/lib/libcurses/check_files/mutt_test5.chk
diff -u src/tests/lib/libcurses/check_files/mutt_test5.chk:1.2 src/tests/lib/libcurses/check_files/mutt_test5.chk:1.3
--- src/tests/lib/libcurses/check_files/mutt_test5.chk:1.2	Thu Sep 19 11:31:57 2019
+++ src/tests/lib/libcurses/check_files/mutt_test5.chk	Tue May  3 

CVS commit: src/tests/lib/libcurses/check_files

2022-05-03 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue May  3 07:26:19 UTC 2022

Modified Files:
src/tests/lib/libcurses/check_files: background4.chk bkgrndset1.chk

Log Message:
Output changed due to bug fixes in curses.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libcurses/check_files/background4.chk
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libcurses/check_files/bkgrndset1.chk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/check_files/background4.chk
diff -u src/tests/lib/libcurses/check_files/background4.chk:1.2 src/tests/lib/libcurses/check_files/background4.chk:1.3
--- src/tests/lib/libcurses/check_files/background4.chk:1.2	Fri Sep 16 08:05:28 2011
+++ src/tests/lib/libcurses/check_files/background4.chk	Tue May  3 07:26:19 2022
@@ -1,5 +1,5 @@
 cup1;14Xcup3;6Xrevwindow
-B1
+ 1
 BB
 BB
 BB

Index: src/tests/lib/libcurses/check_files/bkgrndset1.chk
diff -u src/tests/lib/libcurses/check_files/bkgrndset1.chk:1.1 src/tests/lib/libcurses/check_files/bkgrndset1.chk:1.2
--- src/tests/lib/libcurses/check_files/bkgrndset1.chk:1.1	Wed Apr 20 07:43:05 2022
+++ src/tests/lib/libcurses/check_files/bkgrndset1.chk	Tue May  3 07:26:19 2022
@@ -1 +1 @@
-thissmsoArmsoissmsoArmsoasmsoArmsotestsmsoAAcup2;1Xcup3;1Xcup4;1Xcup5;1Xcup6;1Xcup7;1Xcup8;1Xcup9;1Xcup10;1Xcup11;1Xcup12;1XA
 AAAcup13;1Xcup14;1Xcup15;1Xcup16;1Xcup17;1Xcup18;1Xcup19;1Xcup20;1Xcup21;1Xcup22;1Xcup23;1XAA
 AAcup24;1XAAArmamAsmamcup1;15Xrmso
\ No newline at end of file
+this is a testsmsoAAcup2;1Xcup3;1Xcup4;1Xcup5;1Xcup6;1Xcup7;1Xcup8;1Xcup9;1Xcup10;1Xcup11;1Xcup12;1XA
 

CVS commit: src/tests/lib/libcurses/check_files

2022-05-03 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue May  3 07:26:19 UTC 2022

Modified Files:
src/tests/lib/libcurses/check_files: background4.chk bkgrndset1.chk

Log Message:
Output changed due to bug fixes in curses.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libcurses/check_files/background4.chk
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libcurses/check_files/bkgrndset1.chk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libcurses

2022-05-03 Thread Brett Lymn
if (np) {
@@ -435,6 +440,7 @@ int wborder_set(WINDOW *win, const cchar
 	}
 	while (i <= endx - trcw) {
 		win->alines[0]->line[i].ch = win->bch;
+		win->alines[0]->line[i].cflags |= CA_BACKGROUND;
 		if (_cursesi_copy_nsp(win->bnsp,
   >alines[0]->line[i]) == ERR)
 			return ERR;
@@ -446,6 +452,7 @@ int wborder_set(WINDOW *win, const cchar
 	for (i = blcw; i <= min( endx - cw, endx - brcw); i += cw) {
 		for (j = 0; j < cw; j++) {
 			win->alines[endy]->line[i + j].ch = bottom.vals[0];
+			win->alines[endy]->line[i + j].cflags &= ~CA_BACKGROUND;
 			win->alines[endy]->line[i + j].attr = bottom.attributes;
 			np = win->alines[endy]->line[i + j].nsp;
 			if (np) {
@@ -475,6 +482,7 @@ int wborder_set(WINDOW *win, const cchar
 	}
 	while (i <= endx - brcw) {
 		win->alines[endy]->line[i].ch = win->bch;
+		win->alines[endy]->line[i].cflags |= CA_BACKGROUND;
 		if (_cursesi_copy_nsp(win->bnsp,
   >alines[endy]->line[i]) == ERR)
 			return ERR;
@@ -488,6 +496,7 @@ int wborder_set(WINDOW *win, const cchar
 		(win->flags & __SCROLLOK) && (win->flags & __SCROLLWIN))) {
 		for (i = 0; i < tlcw; i++) {
 			win->alines[0]->line[i].ch = topleft.vals[0];
+			win->alines[0]->line[i].cflags &= ~CA_BACKGROUND;
 			win->alines[0]->line[i].attr = topleft.attributes;
 			np = win->alines[0]->line[i].nsp;
 			if (np) {
@@ -517,6 +526,7 @@ int wborder_set(WINDOW *win, const cchar
 		}
 		for (i = endx - trcw + 1; i <= endx; i++) {
 			win->alines[0]->line[i].ch = topright.vals[0];
+			win->alines[0]->line[i].cflags &= ~CA_BACKGROUND;
 			win->alines[0]->line[i].attr = topright.attributes;
 			np = win->alines[0]->line[i].nsp;
 			if (np) {
@@ -546,6 +556,7 @@ int wborder_set(WINDOW *win, const cchar
 		}
 		for (i = 0; i < blcw; i++) {
 			win->alines[endy]->line[i].ch = botleft.vals[0];
+			win->alines[endy]->line[i].cflags &= ~CA_BACKGROUND;
 			win->alines[endy]->line[i].attr = botleft.attributes;
 			np = win->alines[ endy ]->line[i].nsp;
 			if (np) {
@@ -574,6 +585,7 @@ int wborder_set(WINDOW *win, const cchar
 		}
 		for (i = endx - brcw + 1; i <= endx; i++) {
 			win->alines[endy]->line[i].ch = botright.vals[0];
+			win->alines[endy]->line[i].cflags &= ~CA_BACKGROUND;
 			win->alines[endy]->line[i].attr = botright.attributes;
 			np = win->alines[endy]->line[i].nsp;
 			if (np) {

Index: src/lib/libcurses/clrtobot.c
diff -u src/lib/libcurses/clrtobot.c:1.29 src/lib/libcurses/clrtobot.c:1.30
--- src/lib/libcurses/clrtobot.c:1.29	Tue Apr 12 07:03:04 2022
+++ src/lib/libcurses/clrtobot.c	Tue May  3 07:25:34 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: clrtobot.c,v 1.29 2022/04/12 07:03:04 blymn Exp $	*/
+/*	$NetBSD: clrtobot.c,v 1.30 2022/05/03 07:25:34 blymn 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.29 2022/04/12 07:03:04 blymn Exp $");
+__RCSID("$NetBSD: clrtobot.c,v 1.30 2022/05/03 07:25:34 blymn Exp $");
 #endif
 #endif/* not lint */
 
@@ -97,6 +97,7 @@ wclrtobot(WINDOW *win)
 minx = (int)(sp - win->alines[y]->line);
 
 			sp->ch = bch;
+			sp->cflags |= CA_BACKGROUND;
 			sp->attr = battr | (sp->attr & __ALTCHARSET);
 #ifdef HAVE_WCHAR
 			if (_cursesi_copy_nsp(win->bnsp, sp) == ERR)
Index: src/lib/libcurses/curses.c
diff -u src/lib/libcurses/curses.c:1.29 src/lib/libcurses/curses.c:1.30
--- src/lib/libcurses/curses.c:1.29	Tue Apr 19 22:26:57 2022
+++ src/lib/libcurses/curses.c	Tue May  3 07:25:34 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: curses.c,v 1.29 2022/04/19 22:26:57 blymn Exp $	*/
+/*	$NetBSD: curses.c,v 1.30 2022/05/03 07:25:34 blymn Exp $	*/
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -35,7 +35,7 @@
 #if 0
 static char sccsid[] = "@(#)curses.c	8.3 (Berkeley) 5/4/94";
 #else
-__RCSID("$NetBSD: curses.c,v 1.29 2022/04/19 22:26:57 blymn Exp $");
+__RCSID("$NetBSD: curses.c,v 1.30 2022/05/03 07:25:34 blymn Exp $");
 #endif
 #endif/* not lint */
 
@@ -121,7 +121,7 @@ _cursesi_copy_wchar(__LDATA *src, __LDAT
 {
 	dest->ch = src->ch;
 	dest->attr = src->attr;
-	dest->wflags = src->wflags;
+	dest->cflags = src->cflags;
 	dest->wcols = src->wcols;
 	_cursesi_copy_nsp(src->nsp, dest);
 }

Index: src/lib/libcurses/curses_private.h
diff -u src/lib/libcurses/curses_private.h:1.79 src/lib/libcurses/curses_private.h:1.80
--- src/lib/libcurses/curses_private.h:1.79	Tue Apr 19 22:26:57 2022
+++ src/lib/libcurses/curses_private.h	Tue May  3 07:25:34 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: curses_private.h,v 1.79 2022/04/19 22:26:57 blymn Exp $	*/
+/*	$NetBSD: curses_private.h,v 1.80 2022/05/03 07:25:34 blymn Exp $	*/
 
 /*-
  * Copyright (c) 19

CVS commit: src/lib/libcurses

2022-05-03 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue May  3 07:25:34 UTC 2022

Modified Files:
src/lib/libcurses: add_wchstr.c addbytes.c background.c border.c
clrtobot.c curses.c curses_private.h delch.c erase.c newwin.c
refresh.c

Log Message:
 * Don't redraw the background if the new background character is the
   same as the old one.  This prevents excessive redraws in some
   applications.

 * Fix bug introduced when wbkgrndset was fixed, we cannot blindly
   replace any instance of the old background character with the new one
   because some of those characters were put there by the application
   leading to display corruption.  So flag characters as background when
   they are erased and only update the flagged characters when setting
   the background.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/lib/libcurses/add_wchstr.c
cvs rdiff -u -r1.62 -r1.63 src/lib/libcurses/addbytes.c
cvs rdiff -u -r1.30 -r1.31 src/lib/libcurses/background.c
cvs rdiff -u -r1.23 -r1.24 src/lib/libcurses/border.c
cvs rdiff -u -r1.29 -r1.30 src/lib/libcurses/clrtobot.c \
src/lib/libcurses/curses.c
cvs rdiff -u -r1.79 -r1.80 src/lib/libcurses/curses_private.h
cvs rdiff -u -r1.28 -r1.29 src/lib/libcurses/delch.c
cvs rdiff -u -r1.35 -r1.36 src/lib/libcurses/erase.c
cvs rdiff -u -r1.66 -r1.67 src/lib/libcurses/newwin.c
cvs rdiff -u -r1.122 -r1.123 src/lib/libcurses/refresh.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libcurses

2022-04-27 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Wed Apr 27 22:04:04 UTC 2022

Modified Files:
src/lib/libcurses: move.c

Log Message:
Fix for PR 56243
clear the past EOL flags when moving the cursor - they are no longer
valid as move cannot put the cursor past the EOL.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/lib/libcurses/move.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/move.c
diff -u src/lib/libcurses/move.c:1.23 src/lib/libcurses/move.c:1.24
--- src/lib/libcurses/move.c:1.23	Tue Oct 19 06:41:03 2021
+++ src/lib/libcurses/move.c	Wed Apr 27 22:04:04 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: move.c,v 1.23 2021/10/19 06:41:03 blymn Exp $	*/
+/*	$NetBSD: move.c,v 1.24 2022/04/27 22:04:04 blymn Exp $	*/
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)move.c	8.2 (Berkeley) 5/4/94";
 #else
-__RCSID("$NetBSD: move.c,v 1.23 2021/10/19 06:41:03 blymn Exp $");
+__RCSID("$NetBSD: move.c,v 1.24 2022/04/27 22:04:04 blymn Exp $");
 #endif
 #endif/* not lint */
 
@@ -68,6 +68,10 @@ wmove(WINDOW *win, int y, int x)
 	if (x >= win->maxx || y >= win->maxy)
 		return ERR;
 
+	/* clear the EOL flags for both where we were and where we are going */
+	win->alines[win->cury]->flags &= ~ __ISPASTEOL;
+	win->alines[y]->flags &= ~ __ISPASTEOL;
+
 	win->curx = x;
 	win->cury = y;
 



CVS commit: src/lib/libcurses

2022-04-27 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Wed Apr 27 22:04:04 UTC 2022

Modified Files:
src/lib/libcurses: move.c

Log Message:
Fix for PR 56243
clear the past EOL flags when moving the cursor - they are no longer
valid as move cannot put the cursor past the EOL.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/lib/libcurses/move.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/distrib/sets/lists/tests

2022-04-26 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue Apr 26 22:48:53 UTC 2022

Modified Files:
src/distrib/sets/lists/tests: mi

Log Message:
Added new libcurses test.


To generate a diff of this commit:
cvs rdiff -u -r1.1198 -r1.1199 src/distrib/sets/lists/tests/mi

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.1198 src/distrib/sets/lists/tests/mi:1.1199
--- src/distrib/sets/lists/tests/mi:1.1198	Sun Apr 24 10:36:37 2022
+++ src/distrib/sets/lists/tests/mi	Tue Apr 26 22:48:53 2022
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1198 2022/04/24 10:36:37 rillig Exp $
+# $NetBSD: mi,v 1.1199 2022/04/26 22:48:53 blymn Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -3766,6 +3766,7 @@
 ./usr/tests/lib/libcurses/tests/winwstr			tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libcurses/tests/wprintw			tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libcurses/tests/wredrawln		tests-lib-tests		compattestfile,atf
+./usr/tests/lib/libcurses/tests/wresize			tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libcurses/tests/wscrl			tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libcurses/tests/wsetscrreg		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libcurses/tests/wstandout		tests-lib-tests		compattestfile,atf



CVS commit: src/distrib/sets/lists/tests

2022-04-26 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue Apr 26 22:48:53 UTC 2022

Modified Files:
src/distrib/sets/lists/tests: mi

Log Message:
Added new libcurses test.


To generate a diff of this commit:
cvs rdiff -u -r1.1198 -r1.1199 src/distrib/sets/lists/tests/mi

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses

2022-04-26 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue Apr 26 22:48:36 UTC 2022

Modified Files:
src/tests/lib/libcurses: t_curses.sh
src/tests/lib/libcurses/tests: Makefile
Added Files:
src/tests/lib/libcurses/tests: wresize

Log Message:
Add test for wresize.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/tests/lib/libcurses/t_curses.sh
cvs rdiff -u -r1.6 -r1.7 src/tests/lib/libcurses/tests/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/libcurses/tests/wresize

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/t_curses.sh
diff -u src/tests/lib/libcurses/t_curses.sh:1.30 src/tests/lib/libcurses/t_curses.sh:1.31
--- src/tests/lib/libcurses/t_curses.sh:1.30	Thu Apr 21 07:03:44 2022
+++ src/tests/lib/libcurses/t_curses.sh	Tue Apr 26 22:48:36 2022
@@ -1666,6 +1666,16 @@ wredrawln_body()
 h_run wredrawln
 }
 
+atf_test_case wresize
+wresize_head()
+{
+atf_set "descr" "Tests resizing a window with a subwin"
+}
+wresize_body()
+{
+h_run wresize
+}
+
 ##
 # curses soft label key routines
 ##
@@ -2365,6 +2375,7 @@ atf_init_test_cases()
 	atf_add_test_case is_linetouched
 	atf_add_test_case is_wintouched
 	atf_add_test_case redrawwin
+	atf_add_test_case wresize
 	atf_add_test_case wredrawln
 
 	# curses soft label key routines

Index: src/tests/lib/libcurses/tests/Makefile
diff -u src/tests/lib/libcurses/tests/Makefile:1.6 src/tests/lib/libcurses/tests/Makefile:1.7
--- src/tests/lib/libcurses/tests/Makefile:1.6	Wed Apr 20 07:43:05 2022
+++ src/tests/lib/libcurses/tests/Makefile	Tue Apr 26 22:48:36 2022
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.6 2022/04/20 07:43:05 blymn Exp $
+# $NetBSD: Makefile,v 1.7 2022/04/26 22:48:36 blymn Exp $
 
 NOMAN=		# defined
 
@@ -213,6 +213,7 @@ FILES+=		winsch
 FILES+=		winwstr
 FILES+=		wprintw
 FILES+=		wredrawln
+FILES+=		wresize
 FILES+=		wscrl
 FILES+=		wsetscrreg
 FILES+=		wstandout

Added files:

Index: src/tests/lib/libcurses/tests/wresize
diff -u /dev/null src/tests/lib/libcurses/tests/wresize:1.1
--- /dev/null	Tue Apr 26 22:48:36 2022
+++ src/tests/lib/libcurses/tests/wresize	Tue Apr 26 22:48:36 2022
@@ -0,0 +1,9 @@
+include window
+
+call win2 subwin $win1 5 5 3 6
+check win2 NON_NULL
+#
+call OK wresize $win1 4 4
+#
+call2 4 4 getmaxyx $win1
+call2 3 3 getmaxyx $win2



CVS commit: src/tests/lib/libcurses

2022-04-26 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue Apr 26 22:48:36 UTC 2022

Modified Files:
src/tests/lib/libcurses: t_curses.sh
src/tests/lib/libcurses/tests: Makefile
Added Files:
src/tests/lib/libcurses/tests: wresize

Log Message:
Add test for wresize.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/tests/lib/libcurses/t_curses.sh
cvs rdiff -u -r1.6 -r1.7 src/tests/lib/libcurses/tests/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/libcurses/tests/wresize

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libcurses

2022-04-26 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue Apr 26 22:40:32 UTC 2022

Modified Files:
src/lib/libcurses: resize.c

Log Message:
Fix for PR 55517.
Actually us x values to recalculate subwin columns.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/lib/libcurses/resize.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/resize.c
diff -u src/lib/libcurses/resize.c:1.34 src/lib/libcurses/resize.c:1.35
--- src/lib/libcurses/resize.c:1.34	Tue Jan 25 03:05:06 2022
+++ src/lib/libcurses/resize.c	Tue Apr 26 22:40:32 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: resize.c,v 1.34 2022/01/25 03:05:06 blymn Exp $	*/
+/*	$NetBSD: resize.c,v 1.35 2022/04/26 22:40:32 blymn Exp $	*/
 
 /*
  * Copyright (c) 2001
@@ -33,7 +33,7 @@
 #if 0
 static char sccsid[] = "@(#)resize.c   blymn 2001/08/26";
 #else
-__RCSID("$NetBSD: resize.c,v 1.34 2022/01/25 03:05:06 blymn Exp $");
+__RCSID("$NetBSD: resize.c,v 1.35 2022/04/26 22:40:32 blymn Exp $");
 #endif
 #endif/* not lint */
 
@@ -390,7 +390,7 @@ __resizewin(WINDOW *win, int nlines, int
 			if (swin->begx + x > win->begx + win->maxx)
 x = 0;
 			if (x <= 0)
-x += win->begy + win->maxx - swin->begx;
+x += win->begx + win->maxx - swin->begx;
 			if (x < 1)
 x = 1;
 			__resizewin(swin, y, x);



CVS commit: src/lib/libcurses

2022-04-26 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue Apr 26 22:40:32 UTC 2022

Modified Files:
src/lib/libcurses: resize.c

Log Message:
Fix for PR 55517.
Actually us x values to recalculate subwin columns.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/lib/libcurses/resize.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses

2022-04-21 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Thu Apr 21 07:03:44 UTC 2022

Modified Files:
src/tests/lib/libcurses: t_curses.sh
src/tests/lib/libcurses/tests: bkgrndset

Log Message:
Actually add the bkgrndset test case so it runs plus fix a typo in
the bkgrndset test script.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/tests/lib/libcurses/t_curses.sh
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libcurses/tests/bkgrndset

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/t_curses.sh
diff -u src/tests/lib/libcurses/t_curses.sh:1.29 src/tests/lib/libcurses/t_curses.sh:1.30
--- src/tests/lib/libcurses/t_curses.sh:1.29	Wed Apr 20 07:43:05 2022
+++ src/tests/lib/libcurses/t_curses.sh	Thu Apr 21 07:03:44 2022
@@ -2410,6 +2410,7 @@ atf_init_test_cases()
 	# curses background attribute manipulation routines
 	atf_add_test_case background
 	atf_add_test_case bkgdset
+	atf_add_test_case bkgrndset
 	atf_add_test_case getbkgd
 
 	# curses border drawing routines

Index: src/tests/lib/libcurses/tests/bkgrndset
diff -u src/tests/lib/libcurses/tests/bkgrndset:1.1 src/tests/lib/libcurses/tests/bkgrndset:1.2
--- src/tests/lib/libcurses/tests/bkgrndset:1.1	Wed Apr 20 07:43:05 2022
+++ src/tests/lib/libcurses/tests/bkgrndset	Thu Apr 21 07:03:44 2022
@@ -7,4 +7,4 @@ call OK refresh
 compare bkgrndset1.chk
 call OK erase
 call OK refresh
-compare bgkrndset2.chk
+compare bkgrndset2.chk



CVS commit: src/tests/lib/libcurses

2022-04-21 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Thu Apr 21 07:03:44 UTC 2022

Modified Files:
src/tests/lib/libcurses: t_curses.sh
src/tests/lib/libcurses/tests: bkgrndset

Log Message:
Actually add the bkgrndset test case so it runs plus fix a typo in
the bkgrndset test script.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/tests/lib/libcurses/t_curses.sh
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libcurses/tests/bkgrndset

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses

2022-04-20 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Wed Apr 20 07:43:05 UTC 2022

Modified Files:
src/tests/lib/libcurses: t_curses.sh
src/tests/lib/libcurses/check_files: Makefile
src/tests/lib/libcurses/tests: Makefile
Added Files:
src/tests/lib/libcurses/check_files: bkgrndset1.chk bkgrndset2.chk
src/tests/lib/libcurses/tests: bkgrndset

Log Message:
Add a test for the bkgrndset function


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/tests/lib/libcurses/t_curses.sh
cvs rdiff -u -r1.9 -r1.10 src/tests/lib/libcurses/check_files/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/libcurses/check_files/bkgrndset1.chk \
src/tests/lib/libcurses/check_files/bkgrndset2.chk
cvs rdiff -u -r1.5 -r1.6 src/tests/lib/libcurses/tests/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/libcurses/tests/bkgrndset

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/t_curses.sh
diff -u src/tests/lib/libcurses/t_curses.sh:1.28 src/tests/lib/libcurses/t_curses.sh:1.29
--- src/tests/lib/libcurses/t_curses.sh:1.28	Mon Apr  4 19:33:46 2022
+++ src/tests/lib/libcurses/t_curses.sh	Wed Apr 20 07:43:05 2022
@@ -2011,6 +2011,16 @@ bkgdset_body()
 	h_run bkgdset
 }
 
+atf_test_case bkgrndset
+bkgrndset_head()
+{
+	atf_set "descr" "Validate curses sets the background character using a complex char on stdscr"
+}
+bkgrndset_body()
+{
+	h_run bkgrndset
+}
+
 atf_test_case getbkgd
 getbkgd_head()
 {

Index: src/tests/lib/libcurses/check_files/Makefile
diff -u src/tests/lib/libcurses/check_files/Makefile:1.9 src/tests/lib/libcurses/check_files/Makefile:1.10
--- src/tests/lib/libcurses/check_files/Makefile:1.9	Tue Nov 16 21:02:06 2021
+++ src/tests/lib/libcurses/check_files/Makefile	Wed Apr 20 07:43:05 2022
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.9 2021/11/16 21:02:06 blymn Exp $
+# $NetBSD: Makefile,v 1.10 2022/04/20 07:43:05 blymn Exp $
 
 NOMAN=		# defined
 
@@ -34,6 +34,8 @@ FILES+=		background4.chk
 FILES+=		background5.chk
 FILES+=		bell.chk
 FILES+=		bkgdset1.chk
+FILES+=		bkgrndset1.chk
+FILES+=		bkgrndset2.chk
 FILES+=		blank.chk
 FILES+=		border_set1.chk
 FILES+=		border_set2.chk

Index: src/tests/lib/libcurses/tests/Makefile
diff -u src/tests/lib/libcurses/tests/Makefile:1.5 src/tests/lib/libcurses/tests/Makefile:1.6
--- src/tests/lib/libcurses/tests/Makefile:1.5	Sat Feb 13 06:29:45 2021
+++ src/tests/lib/libcurses/tests/Makefile	Wed Apr 20 07:43:05 2022
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.5 2021/02/13 06:29:45 rillig Exp $
+# $NetBSD: Makefile,v 1.6 2022/04/20 07:43:05 blymn Exp $
 
 NOMAN=		# defined
 
@@ -24,6 +24,7 @@ FILES+=		attributes
 FILES+=		background
 FILES+=		beep
 FILES+=		bkgdset
+FILES+=		bkgrndset
 FILES+=		border_set
 FILES+=		box
 FILES+=		box_set

Added files:

Index: src/tests/lib/libcurses/check_files/bkgrndset1.chk
diff -u /dev/null src/tests/lib/libcurses/check_files/bkgrndset1.chk:1.1
--- /dev/null	Wed Apr 20 07:43:05 2022
+++ src/tests/lib/libcurses/check_files/bkgrndset1.chk	Wed Apr 20 07:43:05 2022
@@ -0,0 +1 @@
+thissmsoArmsoissmsoArmsoasmsoArmsotestsmsoAAcup2;1Xcup3;1Xcup4;1Xcup5;1Xcup6;1Xcup7;1Xcup8;1Xcup9;1Xcup10;1Xcup11;1Xcup12;1XA
 

CVS commit: src/tests/lib/libcurses

2022-04-20 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Wed Apr 20 07:43:05 UTC 2022

Modified Files:
src/tests/lib/libcurses: t_curses.sh
src/tests/lib/libcurses/check_files: Makefile
src/tests/lib/libcurses/tests: Makefile
Added Files:
src/tests/lib/libcurses/check_files: bkgrndset1.chk bkgrndset2.chk
src/tests/lib/libcurses/tests: bkgrndset

Log Message:
Add a test for the bkgrndset function


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/tests/lib/libcurses/t_curses.sh
cvs rdiff -u -r1.9 -r1.10 src/tests/lib/libcurses/check_files/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/libcurses/check_files/bkgrndset1.chk \
src/tests/lib/libcurses/check_files/bkgrndset2.chk
cvs rdiff -u -r1.5 -r1.6 src/tests/lib/libcurses/tests/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/libcurses/tests/bkgrndset

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/distrib/sets/lists/tests

2022-04-20 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Wed Apr 20 07:41:04 UTC 2022

Modified Files:
src/distrib/sets/lists/tests: mi

Log Message:
Add test and check file for bkgrndset


To generate a diff of this commit:
cvs rdiff -u -r1.1193 -r1.1194 src/distrib/sets/lists/tests/mi

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/distrib/sets/lists/tests

2022-04-20 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Wed Apr 20 07:41:04 UTC 2022

Modified Files:
src/distrib/sets/lists/tests: mi

Log Message:
Add test and check file for bkgrndset


To generate a diff of this commit:
cvs rdiff -u -r1.1193 -r1.1194 src/distrib/sets/lists/tests/mi

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.1193 src/distrib/sets/lists/tests/mi:1.1194
--- src/distrib/sets/lists/tests/mi:1.1193	Mon Apr 18 15:06:27 2022
+++ src/distrib/sets/lists/tests/mi	Wed Apr 20 07:41:04 2022
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1193 2022/04/18 15:06:27 rillig Exp $
+# $NetBSD: mi,v 1.1194 2022/04/20 07:41:04 blymn Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -3305,6 +3305,8 @@
 ./usr/tests/lib/libcurses/check_files/background5.chk		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libcurses/check_files/bell.chk			tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libcurses/check_files/bkgdset1.chk		tests-lib-tests		compattestfile,atf
+./usr/tests/lib/libcurses/check_files/bkgrndset1.chk		tests-lib-tests		compattestfile,atf
+./usr/tests/lib/libcurses/check_files/bkgrndset2.chk		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libcurses/check_files/blank.chk			tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libcurses/check_files/border_set1.chk		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libcurses/check_files/border_set2.chk		tests-lib-tests		compattestfile,atf
@@ -3574,6 +3576,7 @@
 ./usr/tests/lib/libcurses/tests/background		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libcurses/tests/beep			tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libcurses/tests/bkgdset			tests-lib-tests		compattestfile,atf
+./usr/tests/lib/libcurses/tests/bkgrndset		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libcurses/tests/border_set		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libcurses/tests/box			tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libcurses/tests/box_set			tests-lib-tests		compattestfile,atf



CVS commit: src/lib/libcurses

2022-04-19 Thread Brett Lymn
 HAVE_WCHAR
+/*
+ * Copy a complex character from source to destination.
+ *
+ */
+void
+_cursesi_copy_wchar(__LDATA *src, __LDATA *dest)
+{
+	dest->ch = src->ch;
+	dest->attr = src->attr;
+	dest->wflags = src->wflags;
+	dest->wcols = src->wcols;
+	_cursesi_copy_nsp(src->nsp, dest);
+}
+
 /*
  * Copy the non-spacing character list (src_nsp) to the given character,
  * allocate or free storage as required.

Index: src/lib/libcurses/curses_private.h
diff -u src/lib/libcurses/curses_private.h:1.78 src/lib/libcurses/curses_private.h:1.79
--- src/lib/libcurses/curses_private.h:1.78	Tue Apr 12 07:03:04 2022
+++ src/lib/libcurses/curses_private.h	Tue Apr 19 22:26:57 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: curses_private.h,v 1.78 2022/04/12 07:03:04 blymn Exp $	*/
+/*	$NetBSD: curses_private.h,v 1.79 2022/04/19 22:26:57 blymn Exp $	*/
 
 /*-
  * Copyright (c) 1998-2000 Brett Lymn
@@ -361,10 +361,12 @@ unsigned int	 __hash_line(const __LDATA 
 void	 __id_subwins(WINDOW *);
 void	 __init_getch(SCREEN *);
 void	 __init_acs(SCREEN *);
+int	 _cursesi_celleq(__LDATA *, __LDATA *);
 #ifdef HAVE_WCHAR
 void	 __init_get_wch(SCREEN *);
 void	 __init_wacs(SCREEN *);
 int	__cputwchar_args( wchar_t, void * );
+void	_cursesi_copy_wchar(__LDATA *, __LDATA *);
 int _cursesi_copy_nsp(nschar_t *, struct __ldata *);
 void	__cursesi_free_nsp(nschar_t *);
 void	__cursesi_win_free_nsp(WINDOW *);

Index: src/lib/libcurses/refresh.c
diff -u src/lib/libcurses/refresh.c:1.121 src/lib/libcurses/refresh.c:1.122
--- src/lib/libcurses/refresh.c:1.121	Wed Apr 13 19:17:09 2022
+++ src/lib/libcurses/refresh.c	Tue Apr 19 22:26:57 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: refresh.c,v 1.121 2022/04/13 19:17:09 pgoyette Exp $	*/
+/*	$NetBSD: refresh.c,v 1.122 2022/04/19 22:26:57 blymn Exp $	*/
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)refresh.c	8.7 (Berkeley) 8/13/94";
 #else
-__RCSID("$NetBSD: refresh.c,v 1.121 2022/04/13 19:17:09 pgoyette Exp $");
+__RCSID("$NetBSD: refresh.c,v 1.122 2022/04/19 22:26:57 blymn Exp $");
 #endif
 #endif/* not lint */
 
@@ -57,7 +57,6 @@ static void	scrolln(int, int, int, int, 
 
 static int	_wnoutrefresh(WINDOW *, int, int, int, int, int, int);
 
-static int celleq(__LDATA *, __LDATA *);
 static int lineeq(__LDATA *, __LDATA *, size_t);
 
 #define	CHECK_INTERVAL		5 /* Change N lines before checking typeahead */
@@ -1174,7 +1173,7 @@ makech(int wy)
 	|| (__using_color && back_color_erase))) {
 		cp = >alines[wy]->line[win->maxx - 1];
 #ifdef HAVE_WCHAR
-		while ((celleq(cp, ) == 1) &&
+		while ((_cursesi_celleq(cp, ) == 1) &&
 #else
 		while (cp->ch == space.ch &&
 #endif /* HAVE_WCHAR */
@@ -1200,7 +1199,7 @@ makech(int wy)
 		__CTRACE(__CTRACE_REFRESH, "makech: wx=%d,lch=%d\n", wx, lch);
 #ifdef HAVE_WCHAR
 		__CTRACE(__CTRACE_REFRESH, "makech: farnarkle: flags 0x%x, wflags 0x%x, color_init %d, celleq %d\n",
-			wlp->flags, nsp->wflags, __do_color_init, celleq(nsp, csp));
+			wlp->flags, nsp->wflags, __do_color_init, _cursesi_celleq(nsp, csp));
 		__CTRACE(__CTRACE_REFRESH, "makech: nsp=(%x,%x,%d,%x,%x,%d,%p)\n",
 			nsp->ch, nsp->attr, nsp->wcols, win->bch, win->battr,
 			win->wcols, nsp->nsp);
@@ -1212,10 +1211,10 @@ makech(int wy)
 #ifdef HAVE_WCHAR
 		((nsp->wflags & WCA_CONTINUATION) != WCA_CONTINUATION) &&
 #endif
-		celleq(nsp, csp))
+		_cursesi_celleq(nsp, csp))
 		{
 			if (wx <= lch) {
-while (wx <= lch && celleq(nsp, csp)) {
+while (wx <= lch && _cursesi_celleq(nsp, csp)) {
 #ifdef HAVE_WCHAR
 	wx += nsp->wcols;
 #else
@@ -1239,7 +1238,7 @@ makech(int wy)
 		_cursesi_screen->lx = wx;
 		owx = wx;
 		while (wx <= lch &&
-		   ((wlp->flags & __ISFORCED) || !celleq(nsp, csp)))
+		   ((wlp->flags & __ISFORCED) || !_cursesi_celleq(nsp, csp)))
 		{
 			if ((ce != NULL) && (wx >= nlsp) &&
 			(nsp->ch == space.ch) &&
@@ -1346,7 +1345,7 @@ makech(int wy)
 			!(win->flags & __SCROLLWIN))
 			{
 tld = nsp;
-if (celleq(, nsp))
+if (_cursesi_celleq(, nsp))
 	tld = 
 
 if (putch(tld, csp, wy, wx) == ERR)
@@ -1711,7 +1710,7 @@ done:
 if (clp->hash != blank_hash ||
 !lineeq(clp->line, clp->line + 1,
 	(__virtscr->maxx - 1)) ||
-!celleq(clp->line, buf))
+!_cursesi_celleq(clp->line, buf))
 {
 	for (i = __virtscr->maxx;
 	i > BLANKSIZE;
@@ -1990,40 +1989,6 @@ __unsetattr(int checkms)
 		__unset_color(curscr);
 }
 
-/* compare two cells on screen, must have the same foreground/background,
- * and for wide characters the same sequence of non-spacing characters
- */
-static int
-celleq(__LDATA *x, __LDATA *y)
-{
-#ifdef HAVE_WCHAR
-	nschar_t *xnp = x->nsp, *ynp = y-&g

CVS commit: src/lib/libcurses

2022-04-19 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue Apr 19 22:26:57 UTC 2022

Modified Files:
src/lib/libcurses: background.c curses.c curses_private.h refresh.c

Log Message:
fix for PR 55496

 * Fix bkgrndset so that it actually sets the background character in
   in line with the SUSv2 specification.

 * Add an internal function to copy a complex character

 * Make the previously static celleq function into a libcurses private
   function so that it can be called in other files.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/lib/libcurses/background.c
cvs rdiff -u -r1.28 -r1.29 src/lib/libcurses/curses.c
cvs rdiff -u -r1.78 -r1.79 src/lib/libcurses/curses_private.h
cvs rdiff -u -r1.121 -r1.122 src/lib/libcurses/refresh.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libcurses

2022-04-12 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue Apr 12 21:54:16 UTC 2022

Modified Files:
src/lib/libcurses: insdelln.c refresh.c

Log Message:
Fix compile breakage when wide char support is disabled.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/lib/libcurses/insdelln.c
cvs rdiff -u -r1.119 -r1.120 src/lib/libcurses/refresh.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/insdelln.c
diff -u src/lib/libcurses/insdelln.c:1.21 src/lib/libcurses/insdelln.c:1.22
--- src/lib/libcurses/insdelln.c:1.21	Tue Apr 12 07:03:04 2022
+++ src/lib/libcurses/insdelln.c	Tue Apr 12 21:54:16 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: insdelln.c,v 1.21 2022/04/12 07:03:04 blymn Exp $	*/
+/*	$NetBSD: insdelln.c,v 1.22 2022/04/12 21:54:16 blymn Exp $	*/
 
 /*
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: insdelln.c,v 1.21 2022/04/12 07:03:04 blymn Exp $");
+__RCSID("$NetBSD: insdelln.c,v 1.22 2022/04/12 21:54:16 blymn Exp $");
 #endif/* not lint */
 
 /*
@@ -158,7 +158,7 @@ winsdelln(WINDOW *win, int nlines)
 win->alines[y]->line[i].ch = win->bch;
 win->alines[y]->line[i].attr = attr;
 win->alines[y]->line[i].ch = win->bch;
-#ifndef HAVE_WCHAR
+#ifdef HAVE_WCHAR
 lp = >alines[y]->line[i];
 lp->wcols = 1;
 if (_cursesi_copy_nsp(win->bnsp, lp) == ERR)

Index: src/lib/libcurses/refresh.c
diff -u src/lib/libcurses/refresh.c:1.119 src/lib/libcurses/refresh.c:1.120
--- src/lib/libcurses/refresh.c:1.119	Tue Apr 12 07:03:04 2022
+++ src/lib/libcurses/refresh.c	Tue Apr 12 21:54:16 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: refresh.c,v 1.119 2022/04/12 07:03:04 blymn Exp $	*/
+/*	$NetBSD: refresh.c,v 1.120 2022/04/12 21:54:16 blymn Exp $	*/
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)refresh.c	8.7 (Berkeley) 8/13/94";
 #else
-__RCSID("$NetBSD: refresh.c,v 1.119 2022/04/12 07:03:04 blymn Exp $");
+__RCSID("$NetBSD: refresh.c,v 1.120 2022/04/12 21:54:16 blymn Exp $");
 #endif
 #endif/* not lint */
 
@@ -1297,8 +1297,8 @@ makech(int wy)
 #ifdef HAVE_WCHAR
 		if (_cursesi_copy_nsp(blank.nsp, csp) == ERR)
 			return ERR;
-#endif /* HAVE_WCHAR */
 		csp->wcols = blank.wcols;
+#endif /* HAVE_WCHAR */
 		assert(csp != );
 		csp++;
 	}



CVS commit: src/lib/libcurses

2022-04-12 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue Apr 12 21:54:16 UTC 2022

Modified Files:
src/lib/libcurses: insdelln.c refresh.c

Log Message:
Fix compile breakage when wide char support is disabled.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/lib/libcurses/insdelln.c
cvs rdiff -u -r1.119 -r1.120 src/lib/libcurses/refresh.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses/check_files

2022-04-12 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue Apr 12 07:04:19 UTC 2022

Modified Files:
src/tests/lib/libcurses/check_files: addstr2.chk addstr3.chk chgat1.chk
chgat2.chk color_blank_draw.chk mvwchgat2.chk slk6.chk wchgat1.chk
wchgat2.chk wchgat3.chk wcolor_set.chk wins_wch3.chk

Log Message:
Update to account for default colour change in libcurses.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libcurses/check_files/addstr2.chk \
src/tests/lib/libcurses/check_files/slk6.chk
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libcurses/check_files/addstr3.chk \
src/tests/lib/libcurses/check_files/wins_wch3.chk
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libcurses/check_files/chgat1.chk \
src/tests/lib/libcurses/check_files/chgat2.chk \
src/tests/lib/libcurses/check_files/color_blank_draw.chk \
src/tests/lib/libcurses/check_files/mvwchgat2.chk \
src/tests/lib/libcurses/check_files/wchgat1.chk \
src/tests/lib/libcurses/check_files/wchgat2.chk \
src/tests/lib/libcurses/check_files/wchgat3.chk \
src/tests/lib/libcurses/check_files/wcolor_set.chk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/check_files/addstr2.chk
diff -u src/tests/lib/libcurses/check_files/addstr2.chk:1.3 src/tests/lib/libcurses/check_files/addstr2.chk:1.4
--- src/tests/lib/libcurses/check_files/addstr2.chk:1.3	Tue Sep  7 01:29:13 2021
+++ src/tests/lib/libcurses/check_files/addstr2.chk	Tue Apr 12 07:04:19 2022
@@ -1 +1 @@
-cup24;1X0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890123456cup24;1Xclearcsr1;24Xhomecup24;1Xindn4Xcsr1;24Xhomehomecup24;76Xa   rmamhsmamcup24;1X
\ No newline at end of file
+cup24;1X0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890123456cup24;1Xclearcup24;76Xa   rmamhsmamcup24;1X
\ No newline at end of file
Index: src/tests/lib/libcurses/check_files/slk6.chk
diff -u src/tests/lib/libcurses/check_files/slk6.chk:1.3 src/tests/lib/libcurses/check_files/slk6.chk:1.4
--- src/tests/lib/libcurses/check_files/slk6.chk:1.3	Tue Jun 22 07:29:16 2021
+++ src/tests/lib/libcurses/check_files/slk6.chk	Tue Apr 12 07:04:19 2022
@@ -1 +1 @@
-opsetaf7Xsetab0Xsmulrev onesgr0setaf7Xsetab0X smulrev  two   sgr0setaf7Xsetab0X smulrevsgr0setaf7Xsetab0X setaf1Xsetab2Xsmulrevfoursgr0setaf7Xsetab0X  smulrev  five  sgr0setaf7Xsetab0X smulrevsgr0setaf7Xsetab0X smulrevsgr0setaf7Xsetab0X smulreveight!!rmam!smamcup24;40Xrmulsgr0op
\ No newline at end of file
+opsetaf7Xsetab0Xsmulrev setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0Xosetaf7Xsetab0Xnsetaf7Xsetab0Xesgr0setaf7Xsetab0X setaf7Xsetab0Xsmulrev setaf7Xsetab0X setaf7Xsetab0Xtsetaf7Xsetab0Xwsetaf7Xsetab0Xosetaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X sgr0setaf7Xsetab0X setaf7Xsetab0Xsmulrev setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X sgr0setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X setaf1Xsetab2Xsmulrev setaf1Xsetab2X setaf1Xsetab2X setaf1Xsetab2X setaf1Xsetab2Xfsetaf1Xsetab2Xosetaf1Xsetab2Xusetaf1Xsetab2Xrsgr0setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0Xsmulrev setaf7Xsetab0X setaf7Xsetab0Xfsetaf7Xsetab0Xisetaf7Xsetab0Xvsetaf7Xsetab0Xesetaf7Xsetab0X setaf7Xsetab0X sgr0setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0Xsmulrev setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X sg
 r0setaf7Xsetab0X setaf7Xsetab0Xsmulrev setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X sgr0setaf7Xsetab0X setaf7Xsetab0Xsmulrevesetaf7Xsetab0Xisetaf7Xsetab0Xgsetaf7Xsetab0Xhsetaf7Xsetab0Xtsetaf7Xsetab0X!setaf7Xsetab0X!rmamsetaf7Xsetab0X!smamcup24;40Xrmulsgr0op
\ No newline at end of file

Index: src/tests/lib/libcurses/check_files/addstr3.chk
diff -u src/tests/lib/libcurses/check_files/addstr3.chk:1.2 src/tests/lib/libcurses/check_files/addstr3.chk:1.3
--- src/tests/lib/libcurses/check_files/addstr3.chk:1.2	Tue Jun 22 07:49:58 2021
+++ src/tests/lib/libcurses/check_files/addstr3.chk	Tue Apr 12 07:04:19 2022
@@ -1,4 +1,5 @@
 csr2;24Xhomehome
 rin1Xcsr1;24Xhomehomecup24;1Xhome
-()cup23;1X0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*cup2;3Xclear
+()cup23;1X0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*cup2;3Xclearcsr2;23Xhome
+rin1Xcsr1;24Xhomehome
 hellocup23;76Xacup2;6X
\ No newline at end of file
Index: src/tests/lib/libcurses/check_files/wins_wch3.chk
diff -u src/tests/lib/libcurses/check_files/wins_wch3.chk:1.2 src/tests/lib/libcurses/check_files/wins_wch3.chk:1.3
--- src/tests/lib/libcurses/check_files/wins_wch3.chk:1.2	Tue Jan 25 03:23:05 2022
+++ src/tests/lib/libcurses/check_files/wins_wch3.chk	

CVS commit: src/tests/lib/libcurses/check_files

2022-04-12 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue Apr 12 07:04:19 UTC 2022

Modified Files:
src/tests/lib/libcurses/check_files: addstr2.chk addstr3.chk chgat1.chk
chgat2.chk color_blank_draw.chk mvwchgat2.chk slk6.chk wchgat1.chk
wchgat2.chk wchgat3.chk wcolor_set.chk wins_wch3.chk

Log Message:
Update to account for default colour change in libcurses.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libcurses/check_files/addstr2.chk \
src/tests/lib/libcurses/check_files/slk6.chk
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libcurses/check_files/addstr3.chk \
src/tests/lib/libcurses/check_files/wins_wch3.chk
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libcurses/check_files/chgat1.chk \
src/tests/lib/libcurses/check_files/chgat2.chk \
src/tests/lib/libcurses/check_files/color_blank_draw.chk \
src/tests/lib/libcurses/check_files/mvwchgat2.chk \
src/tests/lib/libcurses/check_files/wchgat1.chk \
src/tests/lib/libcurses/check_files/wchgat2.chk \
src/tests/lib/libcurses/check_files/wchgat3.chk \
src/tests/lib/libcurses/check_files/wcolor_set.chk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/distrib/sets/lists/base

2022-04-12 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue Apr 12 07:03:29 UTC 2022

Modified Files:
src/distrib/sets/lists/base: shl.mi

Log Message:
Bump libcurses minor


To generate a diff of this commit:
cvs rdiff -u -r1.933 -r1.934 src/distrib/sets/lists/base/shl.mi

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/sets/lists/base/shl.mi
diff -u src/distrib/sets/lists/base/shl.mi:1.933 src/distrib/sets/lists/base/shl.mi:1.934
--- src/distrib/sets/lists/base/shl.mi:1.933	Mon Mar  7 09:45:02 2022
+++ src/distrib/sets/lists/base/shl.mi	Tue Apr 12 07:03:29 2022
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.933 2022/03/07 09:45:02 mrg Exp $
+# $NetBSD: shl.mi,v 1.934 2022/04/12 07:03:29 blymn Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -279,7 +279,7 @@
 ./usr/lib/libctf.so.3.0base-sys-shlib		compatfile,ctf
 ./usr/lib/libcurses.sobase-sys-shlib		compatfile
 ./usr/lib/libcurses.so.9			base-sys-shlib		compatfile
-./usr/lib/libcurses.so.9.0			base-sys-shlib		compatfile
+./usr/lib/libcurses.so.9.1			base-sys-shlib		compatfile
 ./usr/lib/libdes.sobase-crypto-shlib	compatfile
 ./usr/lib/libdes.so.12base-crypto-shlib	compatfile,openssl=10
 ./usr/lib/libdes.so.12.0base-crypto-shlib	compatfile,openssl=10



CVS commit: src/distrib/sets/lists/base

2022-04-12 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue Apr 12 07:03:29 UTC 2022

Modified Files:
src/distrib/sets/lists/base: shl.mi

Log Message:
Bump libcurses minor


To generate a diff of this commit:
cvs rdiff -u -r1.933 -r1.934 src/distrib/sets/lists/base/shl.mi

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libcurses

2022-04-12 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue Apr 12 07:03:05 UTC 2022

Modified Files:
src/lib/libcurses: add_wchstr.c addbytes.c attributes.c background.c
border.c clrtobot.c clrtoeol.c color.c copywin.c curses_private.h
delch.c erase.c get_wstr.c ins_wch.c ins_wstr.c insdelln.c mvwin.c
newwin.c refresh.c shlib_version slk.c touchwin.c

Log Message:
Make the default colour pair be pair 0 which appears to match other
curses implementations.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/lib/libcurses/add_wchstr.c
cvs rdiff -u -r1.61 -r1.62 src/lib/libcurses/addbytes.c
cvs rdiff -u -r1.33 -r1.34 src/lib/libcurses/attributes.c \
src/lib/libcurses/clrtoeol.c src/lib/libcurses/touchwin.c
cvs rdiff -u -r1.28 -r1.29 src/lib/libcurses/background.c \
src/lib/libcurses/clrtobot.c
cvs rdiff -u -r1.22 -r1.23 src/lib/libcurses/border.c \
src/lib/libcurses/ins_wstr.c
cvs rdiff -u -r1.45 -r1.46 src/lib/libcurses/color.c
cvs rdiff -u -r1.20 -r1.21 src/lib/libcurses/copywin.c \
src/lib/libcurses/insdelln.c
cvs rdiff -u -r1.77 -r1.78 src/lib/libcurses/curses_private.h
cvs rdiff -u -r1.27 -r1.28 src/lib/libcurses/delch.c
cvs rdiff -u -r1.34 -r1.35 src/lib/libcurses/erase.c
cvs rdiff -u -r1.10 -r1.11 src/lib/libcurses/get_wstr.c
cvs rdiff -u -r1.18 -r1.19 src/lib/libcurses/ins_wch.c
cvs rdiff -u -r1.23 -r1.24 src/lib/libcurses/mvwin.c
cvs rdiff -u -r1.65 -r1.66 src/lib/libcurses/newwin.c
cvs rdiff -u -r1.118 -r1.119 src/lib/libcurses/refresh.c
cvs rdiff -u -r1.46 -r1.47 src/lib/libcurses/shlib_version
cvs rdiff -u -r1.19 -r1.20 src/lib/libcurses/slk.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libcurses

2022-04-12 Thread Brett Lymn
de "curses.h"
@@ -39,6 +39,7 @@ __RCSID("$NetBSD: color.c,v 1.45 2021/12
 
 /* Have we initialised colours? */
 int	__using_color = 0;
+int	__do_color_init = 0; /* force refresh to init color in all cells */
 
 /* Default colour number */
 attr_t	__default_color = 0;
@@ -110,7 +111,11 @@ start_color(void)
 			COLOR_PAIRS = (max_pairs > MAX_PAIRS - 1 ?
 			MAX_PAIRS - 1 : max_pairs);
 			 /* Use the last colour pair for curses default. */
+#ifdef __OLD_DEFAULT_COLOR
 			__default_color = COLOR_PAIR(MAX_PAIRS - 1);
+#else
+			__default_color = COLOR_PAIR(0);
+#endif
 		}
 	}
 	if (!COLORS)
@@ -235,6 +240,7 @@ start_color(void)
 	__default_pair.flags;
 
 	__using_color = 1;
+	__do_color_init = 1;
 
 	/* Set all positions on all windows to curses default colours. */
 	for (wlp = _cursesi_screen->winlistp; wlp != NULL; wlp = wlp->nextp) {
@@ -243,12 +249,13 @@ start_color(void)
 			/* Set color attribute on other windows */
 			win->battr |= __default_color;
 			for (y = 0; y < win->maxy; y++) {
+win->alines[y]->flags |= __ISFORCED;
 for (x = 0; x < win->maxx; x++) {
 	win->alines[y]->line[x].attr &= ~__COLOR;
 	win->alines[y]->line[x].attr |= __default_color;
 }
 			}
-			__touchwin(win);
+			__touchwin(win, 0);
 		}
 	}
 
@@ -528,7 +535,8 @@ __set_color( /*ARGSUSED*/ WINDOW *win, a
 {
 	short	pair;
 
-	if ((curscr->wattr & __COLOR) == (attr & __COLOR))
+	if ((__do_color_init != 1) &&
+	((curscr->wattr & __COLOR) == (attr & __COLOR)))
 		return;
 
 	pair = PAIR_NUMBER((uint32_t)attr);

Index: src/lib/libcurses/copywin.c
diff -u src/lib/libcurses/copywin.c:1.20 src/lib/libcurses/copywin.c:1.21
--- src/lib/libcurses/copywin.c:1.20	Mon Sep  6 07:03:49 2021
+++ src/lib/libcurses/copywin.c	Tue Apr 12 07:03:04 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: copywin.c,v 1.20 2021/09/06 07:03:49 rin Exp $	*/
+/*	$NetBSD: copywin.c,v 1.21 2022/04/12 07:03:04 blymn Exp $	*/
 
 /*-
  * Copyright (c) 1998-1999 Brett Lymn
@@ -31,7 +31,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: copywin.c,v 1.20 2021/09/06 07:03:49 rin Exp $");
+__RCSID("$NetBSD: copywin.c,v 1.21 2022/04/12 07:03:04 blymn Exp $");
 #endif/* not lint */
 
 #include 
@@ -134,6 +134,6 @@ int copywin(const WINDOW *srcwin, WINDOW
 			}
 		}
 	}
-	__touchwin(dstwin);
+	__touchwin(dstwin, 0);
 	return OK;
 }
Index: src/lib/libcurses/insdelln.c
diff -u src/lib/libcurses/insdelln.c:1.20 src/lib/libcurses/insdelln.c:1.21
--- src/lib/libcurses/insdelln.c:1.20	Tue Jan 25 03:05:06 2022
+++ src/lib/libcurses/insdelln.c	Tue Apr 12 07:03:04 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: insdelln.c,v 1.20 2022/01/25 03:05:06 blymn Exp $	*/
+/*	$NetBSD: insdelln.c,v 1.21 2022/04/12 07:03:04 blymn Exp $	*/
 
 /*
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: insdelln.c,v 1.20 2022/01/25 03:05:06 blymn Exp $");
+__RCSID("$NetBSD: insdelln.c,v 1.21 2022/04/12 07:03:04 blymn Exp $");
 #endif/* not lint */
 
 /*
@@ -116,11 +116,8 @@ winsdelln(WINDOW *win, int nlines)
 			for (i = 0; i < win->maxx; i++) {
 win->alines[y]->line[i].ch = win->bch;
 win->alines[y]->line[i].attr = attr;
-#ifndef HAVE_WCHAR
 win->alines[y]->line[i].ch = win->bch;
-#else
-win->alines[y]->line[i].ch
-	= (wchar_t)btowc((int)win->bch );
+#ifdef HAVE_WCHAR
 lp = >alines[y]->line[i];
 if (_cursesi_copy_nsp(win->bnsp, lp) == ERR)
 	return ERR;
@@ -160,11 +157,8 @@ winsdelln(WINDOW *win, int nlines)
 			for (i = 0; i < win->maxx; i++) {
 win->alines[y]->line[i].ch = win->bch;
 win->alines[y]->line[i].attr = attr;
-#ifndef HAVE_WCHAR
 win->alines[y]->line[i].ch = win->bch;
-#else
-win->alines[y]->line[i].ch
-	= (wchar_t)btowc((int)win->bch);
+#ifndef HAVE_WCHAR
 lp = >alines[y]->line[i];
 lp->wcols = 1;
 if (_cursesi_copy_nsp(win->bnsp, lp) == ERR)

Index: src/lib/libcurses/curses_private.h
diff -u src/lib/libcurses/curses_private.h:1.77 src/lib/libcurses/curses_private.h:1.78
--- src/lib/libcurses/curses_private.h:1.77	Tue Jan 25 03:05:06 2022
+++ src/lib/libcurses/curses_private.h	Tue Apr 12 07:03:04 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: curses_private.h,v 1.77 2022/01/25 03:05:06 blymn Exp $	*/
+/*	$NetBSD: curses_private.h,v 1.78 2022/04/12 07:03:04 blymn Exp $	*/
 
 /*-
  * Copyright (c) 1998-2000 Brett Lymn
@@ -404,7 +404,7 @@ void	 __swflags(WINDOW *);
 void	 __sync(WINDOW *);
 int	 __timeout(int);
 int	 __touchline(WINDOW *, int, int, int);
-int	 __touchwin(WINDOW *);
+int	 __touchwin(WINDOW *, int);
 int	 __unripoffline(int (*)(WINDOW *, int));
 void	 __unsetattr(int);
 void	 __unset_color(WINDOW *win);

Index: src/lib/libcurses/delch.c
diff -u src/lib/libcurses/delch.c:1.27 src/lib/libcurses/delch.c:1.28
--- src/lib/libcurses/delch.c:1.27	Tue Jan 25

CVS commit: src/sys/dev/pckbport

2022-04-04 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Mon Apr  4 07:04:21 UTC 2022

Modified Files:
src/sys/dev/pckbport: synaptics.c

Log Message:
Use the original right boundary when calculating the vertical scroll
region so the boundary does not creep left on each subsequent setting.
Thanks to Martin@ for the report.


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/sys/dev/pckbport/synaptics.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pckbport/synaptics.c
diff -u src/sys/dev/pckbport/synaptics.c:1.77 src/sys/dev/pckbport/synaptics.c:1.78
--- src/sys/dev/pckbport/synaptics.c:1.77	Fri Apr  1 06:31:29 2022
+++ src/sys/dev/pckbport/synaptics.c	Mon Apr  4 07:04:20 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: synaptics.c,v 1.77 2022/04/01 06:31:29 blymn Exp $	*/
+/*	$NetBSD: synaptics.c,v 1.78 2022/04/04 07:04:20 blymn Exp $	*/
 
 /*
  * Copyright (c) 2005, Steve C. Woodford
@@ -48,7 +48,7 @@
 #include "opt_pms.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.77 2022/04/01 06:31:29 blymn Exp $");
+__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.78 2022/04/04 07:04:20 blymn Exp $");
 
 #include 
 #include 
@@ -255,7 +255,8 @@ static void
 pms_synaptics_set_boundaries(void)
 {
 	if (synaptics_vert_pct != synaptics_old_vert_pct ) {
-		synaptics_edge_right -= ((unsigned long) synaptics_vert_pct *
+		synaptics_edge_right = synaptics_actual_edge_right -
+		((unsigned long) synaptics_vert_pct *
 		(synaptics_actual_edge_right - synaptics_edge_left)) / 100;
 		synaptics_old_vert_pct = synaptics_vert_pct;
 		synaptics_old_vert_edge = synaptics_edge_right;
@@ -270,6 +271,7 @@ pms_synaptics_set_boundaries(void)
 			((unsigned long) 100 * synaptics_edge_right) /
 			(synaptics_actual_edge_right - synaptics_edge_left);
 		}
+		synaptics_old_vert_pct = synaptics_vert_pct;
 		synaptics_old_vert_edge = synaptics_edge_right;
 	}
 



CVS commit: src/sys/dev/pckbport

2022-04-04 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Mon Apr  4 07:04:21 UTC 2022

Modified Files:
src/sys/dev/pckbport: synaptics.c

Log Message:
Use the original right boundary when calculating the vertical scroll
region so the boundary does not creep left on each subsequent setting.
Thanks to Martin@ for the report.


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/sys/dev/pckbport/synaptics.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/share/man/man4

2022-04-01 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Fri Apr  1 06:32:10 UTC 2022

Modified Files:
src/share/man/man4: pms.4

Log Message:
Update documentation to clean up obsolete settings and add new ones.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/share/man/man4/pms.4

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man4/pms.4
diff -u src/share/man/man4/pms.4:1.40 src/share/man/man4/pms.4:1.41
--- src/share/man/man4/pms.4:1.40	Thu Oct 21 07:33:13 2021
+++ src/share/man/man4/pms.4	Fri Apr  1 06:32:10 2022
@@ -1,4 +1,4 @@
-.\" $NetBSD: pms.4,v 1.40 2021/10/21 07:33:13 wiz Exp $
+.\" $NetBSD: pms.4,v 1.41 2022/04/01 06:32:10 blymn Exp $
 .\"
 .\" Copyright (c) 1993 Christopher G. Demetriou
 .\" All rights reserved.
@@ -182,11 +182,27 @@ fingers that are located in the button e
 If set to 0 (the default) finger movements will not be reported.
 If set to 1 finger movements will be reported.
 .It Dv hw.synaptics.button_boundary
-Sets the top edge of the button emulation region on a clickpad.
+.It Dv hw.synaptics.button_region_percent
+These two items are interrelated in that setting one will affect
+the value of the other.
 Since a clickpad only reports left clicks this region is used to emulate
 two or three buttons by detecting the finger location and reporting
 either a button 2 or button 3 click if the click occurs within
 the region bounded by button_boundary and the bottom of the clickpad.
+.Va hw.synaptics.button_boundary
+sets the top edge of the button emulation region on a clickpad and
+the percentage that represents this value is calculated and stored
+in
+.Va hw.synaptics.button_region_percent
+Conversely, if
+.Va hw.synaptics.button_region_percent
+is set then the equivalent value for
+.Va hw.synaptics.button_boundary
+is calculated and stored.
+Using a percentage allows the button region for trackpads that are able
+to report their maximum and minimum values to be reliably set to
+occupy a defined portion of the trackpad area instead of the user having
+to tweak an arbitrary number.
 .It Dv hw.synaptics.button3_edge
 This defines the left hand edge of the button 3 region.
 If a click occurs in the region bounded by button_boundary, button3_edge
@@ -203,33 +219,23 @@ event.
 For completeness, the region between the left hand side of the clickpad,
 button2_edge and button_boundary will be reported as a button1 event
 as will any clicks that occur outside the button emulation region.
-.It Dv hw.synaptics.finger_scroll-min
-The minimum finger width at which the driver will start reporting
-vertical movements as Z axis events.
-Effectively, this emulates a mouse scroll wheel by the user using two
-fingers together on the click pad.
-The default value is 5, this value cannot be less than 5 due to the way
-the clickpad reports finger width.
-.It Dv hw.synaptics.finger_scroll-max
-The maximum finger width at which the driver will report finger
-movement as Z axis events.
-The default value is 12 and cannot be greater than 14.
-.It Dv hw.synaptics.finger_scroll-hysteresis
-This defines the number of packets to continue with the Z axis emulation.
-Due to the nature of the clickpad maintaining constant contact can be
-difficult.
-This hysteresis value prevents the driver flipping between two finger
-scroll and normal mouse movement erratically.
-Each time a valid finger scroll width is detected the packet count is
-reset.
-If this variable is set too high then mouse movements will be interpreted
-as Z-axis events after the two finger scoll has finished.
-If the variable is set too low then there will be mouse movements observed
-during the two finger scroll.
 .It Dv hw.synaptics.aux_mid_button_scroll
 This causes Y-axis movement on the "passthrough device" (e.g. the TrackPoint
 on ThinkPads) to result in scrolling events instead of Y-axis movement when
 the middle button is held.
+.It Dv hw.synaptics.vert_scroll_percent
+Reserve this percentage of the trackpad for a vertical scroll region.
+This will reduce
+.Va hw.synaptics.edge_right
+by this percentage.
+.It Dv hw.synaptics.horizontal_scroll_percent
+Reserve this percentage of the trackpad for a horizontal scroll region.
+This will reduce
+.Va hw.synaptics.edge_bottom
+by this percentage.
+The 
+.Va hw.synaptics.button_boundary
+will be recalculated as a result of the change.
 .El
 .Pp
 The following



CVS commit: src/share/man/man4

2022-04-01 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Fri Apr  1 06:32:10 UTC 2022

Modified Files:
src/share/man/man4: pms.4

Log Message:
Update documentation to clean up obsolete settings and add new ones.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/share/man/man4/pms.4

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pckbport

2022-04-01 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Fri Apr  1 06:31:30 UTC 2022

Modified Files:
src/sys/dev/pckbport: synaptics.c synapticsvar.h

Log Message:
Fix regression introduced when fixing PR kern/56613 and related tweaks

* A trackpad with external buttons needs to mask a number of lower bits
  of the X and Y coordinates IFF a button is down.  This was not being
  done so a button held down looked like an out of range packet and
  was therefore dropped.

* Now that trackpads are probed for their boundaries make the emulated
  button boundary settable by a percentage, also allow the right and
  bottom boundaries to be adjusted by a percentage to allow for
  horizontal and vertical scroll regions.


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/sys/dev/pckbport/synaptics.c
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/pckbport/synapticsvar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pckbport/synaptics.c
diff -u src/sys/dev/pckbport/synaptics.c:1.76 src/sys/dev/pckbport/synaptics.c:1.77
--- src/sys/dev/pckbport/synaptics.c:1.76	Thu Mar  3 21:03:14 2022
+++ src/sys/dev/pckbport/synaptics.c	Fri Apr  1 06:31:29 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: synaptics.c,v 1.76 2022/03/03 21:03:14 blymn Exp $	*/
+/*	$NetBSD: synaptics.c,v 1.77 2022/04/01 06:31:29 blymn Exp $	*/
 
 /*
  * Copyright (c) 2005, Steve C. Woodford
@@ -48,7 +48,7 @@
 #include "opt_pms.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.76 2022/03/03 21:03:14 blymn Exp $");
+__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.77 2022/04/01 06:31:29 blymn Exp $");
 
 #include 
 #include 
@@ -112,9 +112,12 @@ static int synaptics_edge_bottom = SYNAP
 static int synaptics_edge_motion_delta = 32;
 static u_int synaptics_finger_high = SYNAPTICS_FINGER_LIGHT + 5;
 static u_int synaptics_finger_low = SYNAPTICS_FINGER_LIGHT - 10;
-static int synaptics_button_boundary = SYNAPTICS_EDGE_BOTTOM + 720;
-static int synaptics_button2 = SYNAPTICS_EDGE_LEFT + (SYNAPTICS_EDGE_RIGHT - SYNAPTICS_EDGE_LEFT) / 3;
-static int synaptics_button3 = SYNAPTICS_EDGE_LEFT + 2 * (SYNAPTICS_EDGE_RIGHT - SYNAPTICS_EDGE_LEFT) / 3;
+static int synaptics_horiz_pct = 0;
+static int synaptics_vert_pct = 0;
+static int synaptics_button_pct = 30;
+static int synaptics_button_boundary;
+static int synaptics_button2;
+static int synaptics_button3;
 static int synaptics_two_fingers_emul = 0;
 static int synaptics_scale_x = 16;
 static int synaptics_scale_y = 16;
@@ -163,6 +166,23 @@ static int synaptics_movement_threshold_
 static int synaptics_movement_enable_nodenum;
 static int synaptics_button_region_movement_nodenum;
 static int synaptics_aux_mid_button_scroll_nodenum;
+static int synaptics_horiz_pct_nodenum;
+static int synaptics_vert_pct_nodenum;
+static int synaptics_button_pct_nodenum;
+
+/*
+ * copy of edges so we can recalculate edge limit if there is 
+ * vertical scroll region
+ */
+static int synaptics_actual_edge_right;
+static int synaptics_actual_edge_bottom;
+
+static int synaptics_old_vert_pct = 0;
+static int synaptics_old_horiz_pct = 0;
+static int synaptics_old_button_pct = 0;
+static int synaptics_old_button_boundary = SYNAPTICS_EDGE_BOTTOM;
+static int synaptics_old_horiz_edge = SYNAPTICS_EDGE_BOTTOM;
+static int synaptics_old_vert_edge = SYNAPTICS_EDGE_RIGHT;
 
 /*
  * This holds the processed packet data, it is global because multiple
@@ -232,6 +252,84 @@ synaptics_special_write(struct pms_softc
 }
 
 static void
+pms_synaptics_set_boundaries(void)
+{
+	if (synaptics_vert_pct != synaptics_old_vert_pct ) {
+		synaptics_edge_right -= ((unsigned long) synaptics_vert_pct *
+		(synaptics_actual_edge_right - synaptics_edge_left)) / 100;
+		synaptics_old_vert_pct = synaptics_vert_pct;
+		synaptics_old_vert_edge = synaptics_edge_right;
+	}
+
+	if (synaptics_edge_right != synaptics_old_vert_edge) {
+		if (synaptics_edge_right >= synaptics_actual_edge_right) {
+			synaptics_vert_pct = 0;
+			synaptics_edge_right = synaptics_actual_edge_right;
+		} else {
+			synaptics_vert_pct = 100 -
+			((unsigned long) 100 * synaptics_edge_right) /
+			(synaptics_actual_edge_right - synaptics_edge_left);
+		}
+		synaptics_old_vert_edge = synaptics_edge_right;
+	}
+
+	if (synaptics_horiz_pct != synaptics_old_horiz_pct ) {
+		synaptics_edge_bottom = synaptics_actual_edge_bottom +
+		((unsigned long) synaptics_horiz_pct *
+		(synaptics_edge_top - synaptics_actual_edge_bottom)) / 100;
+		synaptics_old_horiz_pct = synaptics_horiz_pct;
+		synaptics_old_horiz_edge = synaptics_edge_bottom;
+	}
+
+	if (synaptics_edge_bottom != synaptics_old_horiz_edge) {
+		if (synaptics_edge_bottom <= synaptics_actual_edge_bottom) {
+			synaptics_vert_pct = 0;
+			synaptics_edge_bottom = synaptics_actual_edge_bottom;
+		} else {
+			synaptics_horiz_pct = 100 -
+			((unsigned long) 100 * synaptics_edge_bottom) /
+			(synaptics_edge_top - 

CVS commit: src/sys/dev/pckbport

2022-04-01 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Fri Apr  1 06:31:30 UTC 2022

Modified Files:
src/sys/dev/pckbport: synaptics.c synapticsvar.h

Log Message:
Fix regression introduced when fixing PR kern/56613 and related tweaks

* A trackpad with external buttons needs to mask a number of lower bits
  of the X and Y coordinates IFF a button is down.  This was not being
  done so a button held down looked like an out of range packet and
  was therefore dropped.

* Now that trackpads are probed for their boundaries make the emulated
  button boundary settable by a percentage, also allow the right and
  bottom boundaries to be adjusted by a percentage to allow for
  horizontal and vertical scroll regions.


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/sys/dev/pckbport/synaptics.c
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/pckbport/synapticsvar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pckbport

2022-03-03 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Thu Mar  3 21:03:14 UTC 2022

Modified Files:
src/sys/dev/pckbport: synaptics.c synapticsreg.h synapticsvar.h

Log Message:
Fix for PR kern/56613

* For trackpads that report max and min coordinates, retrieve these and
  use them as the boundaries instead of the hard coded limits.
* Drop packets that are have x/y values that are outside the limits of
  the trackpad.  Some trackpads report a stream of low values in some
  situations that cause cursor jumping.


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/sys/dev/pckbport/synaptics.c
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/pckbport/synapticsreg.h \
src/sys/dev/pckbport/synapticsvar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pckbport/synaptics.c
diff -u src/sys/dev/pckbport/synaptics.c:1.75 src/sys/dev/pckbport/synaptics.c:1.76
--- src/sys/dev/pckbport/synaptics.c:1.75	Sat Dec  4 14:53:56 2021
+++ src/sys/dev/pckbport/synaptics.c	Thu Mar  3 21:03:14 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: synaptics.c,v 1.75 2021/12/04 14:53:56 nia Exp $	*/
+/*	$NetBSD: synaptics.c,v 1.76 2022/03/03 21:03:14 blymn Exp $	*/
 
 /*
  * Copyright (c) 2005, Steve C. Woodford
@@ -48,7 +48,7 @@
 #include "opt_pms.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.75 2021/12/04 14:53:56 nia Exp $");
+__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.76 2022/03/03 21:03:14 blymn Exp $");
 
 #include 
 #include 
@@ -342,6 +342,12 @@ pms_synaptics_probe_extended(struct pms_
 
 			if ((val & SYN_CCAP_HAS_ADV_GESTURE_MODE))
 sc->flags |= SYN_FLAG_HAS_ADV_GESTURE_MODE;
+
+			if ((val & SYN_CCAP_REPORT_MAX))
+sc->flags |= SYN_FLAG_HAS_MAX_REPORT;
+
+			if ((val & SYN_CCAP_REPORT_MIN))
+sc->flags |= SYN_FLAG_HAS_MIN_REPORT;
 		}
 	}
 }
@@ -362,6 +368,8 @@ static const struct {
 	{ SYN_FLAG_HAS_HORIZONTAL_SCROLL, "Horizontal scroll", },
 	{ SYN_FLAG_HAS_MULTI_FINGER_REPORT, "Multi-finger Report", },
 	{ SYN_FLAG_HAS_MULTI_FINGER, "Multi-finger", },
+	{ SYN_FLAG_HAS_MAX_REPORT, "Reports max", },
+	{ SYN_FLAG_HAS_MIN_REPORT, "Reports min", },
 };
 
 int
@@ -444,6 +452,42 @@ pms_synaptics_probe_init(void *vsc)
 		aprint_normal("\n");
 	}
 
+	if (sc->flags & SYN_FLAG_HAS_MAX_REPORT) {
+		res = synaptics_special_read(psc, SYNAPTICS_READ_MAX_COORDS,
+		resp);
+		if (res) {
+			aprint_error_dev(psc->sc_dev,
+			"synaptics_probe: Failed to query max coords.\n");
+		} else {
+			synaptics_edge_right = (resp[0] << 5) +
+			((resp[1] & 0x0f) << 1);
+			synaptics_edge_top = (resp[2] << 5) + 
+			((resp[1] & 0xf0) >> 3);
+
+			aprint_normal_dev(psc->sc_dev,
+			"Probed max coordinates right: %d, top: %d\n",
+			synaptics_edge_right, synaptics_edge_top);
+		}
+	}
+
+	if (sc->flags & SYN_FLAG_HAS_MIN_REPORT) {
+		res = synaptics_special_read(psc, SYNAPTICS_READ_MIN_COORDS,
+		resp);
+		if (res) {
+			aprint_error_dev(psc->sc_dev,
+			"synaptics_probe: Failed to query min coords.\n");
+		} else {
+			synaptics_edge_left = (resp[0] << 5) +
+			((resp[1] & 0x0f) << 1);
+			synaptics_edge_bottom = (resp[2] << 5) + 
+			((resp[1] & 0xf0) >> 3);
+
+			aprint_normal_dev(psc->sc_dev,
+			"Probed min coordinates left: %d, bottom: %d\n",
+			synaptics_edge_left, synaptics_edge_bottom);
+		}
+	}
+
 done:
 	pms_sysctl_synaptics();
 	pckbport_set_inputhandler(psc->sc_kbctag, psc->sc_kbcslot,
@@ -1068,6 +1112,27 @@ pms_synaptics_parse(struct pms_softc *ps
 			nsp.sp_sz = (psc->packet[3] & 0x30)
 			+ ((psc->packet[5] & 0x0e) << 1);
 
+			/*
+			 * Check if the x and y are non-zero that they
+			 * are within the bounds of the trackpad
+			 * otherwise ignore the packet.
+			 */
+			if (((nsp.sp_sx != 0) &&
+			((nsp.sp_sx < synaptics_edge_left) ||
+			 (nsp.sp_sx > synaptics_edge_right))) ||
+			   ((nsp.sp_sy != 0) &&
+			((nsp.sp_sy < synaptics_edge_bottom) ||
+			 (nsp.sp_sy > synaptics_edge_top {
+sc->gesture_type = 0;
+sc->gesture_buttons = 0;
+sc->total_packets--;
+DPRINTF(20, sc,
+"synaptics_parse: dropping out of bounds "
+"packet sp_sx %d sp_sy %d\n",
+nsp.sp_sx, nsp.sp_sy);
+return;
+			}
+
 			/* work out the virtual finger width */
 			v = 8 + (psc->packet[1] & 0x01) +
 ((psc->packet[2] & 0x01) << 1) +
@@ -1152,6 +1217,27 @@ pms_synaptics_parse(struct pms_softc *ps
 			nsp.sp_z = psc->packet[2];
 		}
 
+		/*
+		 * Check if the x and y are non-zero that they
+		 * are within the bounds of the trackpad
+		 * otherwise ignore the packet.
+		 */
+		if (((nsp.sp_x != 0) &&
+		((nsp.sp_x < synaptics_edge_left) ||
+		 (nsp.sp_x > synaptics_edge_right))) ||
+		((nsp.sp_y != 0) &&
+		((nsp.sp_y < synaptics_edge_bottom) ||
+		 (nsp.sp_y > synaptics_edge_top {
+			sc->gesture_type = 0;
+			sc->gesture_buttons = 0;
+			sc->total_packets--;
+			DPRINTF(20, sc,
+			

CVS commit: src/sys/dev/pckbport

2022-03-03 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Thu Mar  3 21:03:14 UTC 2022

Modified Files:
src/sys/dev/pckbport: synaptics.c synapticsreg.h synapticsvar.h

Log Message:
Fix for PR kern/56613

* For trackpads that report max and min coordinates, retrieve these and
  use them as the boundaries instead of the hard coded limits.
* Drop packets that are have x/y values that are outside the limits of
  the trackpad.  Some trackpads report a stream of low values in some
  situations that cause cursor jumping.


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/sys/dev/pckbport/synaptics.c
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/pckbport/synapticsreg.h \
src/sys/dev/pckbport/synapticsvar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses

2022-02-28 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue Mar  1 06:41:27 UTC 2022

Modified Files:
src/tests/lib/libcurses: debug_test

Log Message:
Add the -F flag to the getopt string, it was there in the help and
in the arguments handling but getopt was not told about it.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/lib/libcurses/debug_test

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/debug_test
diff -u src/tests/lib/libcurses/debug_test:1.6 src/tests/lib/libcurses/debug_test:1.7
--- src/tests/lib/libcurses/debug_test:1.6	Tue Jan 25 03:23:05 2022
+++ src/tests/lib/libcurses/debug_test	Tue Mar  1 06:41:27 2022
@@ -41,7 +41,7 @@ usage() {
 #ARGS="-T ${BASEDIR} -I ${INCLUDE_PATH} -C ${CHECK_PATH}"
 ARGS="-T ${BASEDIR} -C ${CHECK_PATH}"
 #
-while getopts cf:L:s:vg opt
+while getopts cf:F:L:s:vg opt
 do
 case "${opt}" in
 	c)



CVS commit: src/tests/lib/libcurses

2022-02-28 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue Mar  1 06:41:27 UTC 2022

Modified Files:
src/tests/lib/libcurses: debug_test

Log Message:
Add the -F flag to the getopt string, it was there in the help and
in the arguments handling but getopt was not told about it.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/lib/libcurses/debug_test

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



  1   2   3   4   >