Module Name:    src
Committed By:   martin
Date:           Tue Oct 10 13:17:46 UTC 2023

Modified Files:
        src/lib/libcurses [netbsd-10]: addbytes.c tty.c
        src/tests/lib/libcurses/check_files [netbsd-10]: addstr3.chk
            waddstr2.chk

Log Message:
Pull up following revision(s) (requested by kim in ticket #402):

        tests/lib/libcurses/check_files/waddstr2.chk: revision 1.2
        tests/lib/libcurses/check_files/addstr3.chk: revision 1.5
        lib/libcurses/addbytes.c: revision 1.69
        lib/libcurses/tty.c: revision 1.50

Fix for install/56467

Set x to 0 before calling scroll based on a  proposed fix by RVP (thanks!)
Update check files affected by a fix to addbyte.c in libcurses.

Correct the fd closed check so we actually check the outfd as per
the comment.  Thanks for jdc%netbsd.org@localhost for catching this one.


To generate a diff of this commit:
cvs rdiff -u -r1.67.2.1 -r1.67.2.2 src/lib/libcurses/addbytes.c
cvs rdiff -u -r1.49 -r1.49.2.1 src/lib/libcurses/tty.c
cvs rdiff -u -r1.4 -r1.4.2.1 src/tests/lib/libcurses/check_files/addstr3.chk
cvs rdiff -u -r1.1 -r1.1.2.1 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/lib/libcurses/addbytes.c
diff -u src/lib/libcurses/addbytes.c:1.67.2.1 src/lib/libcurses/addbytes.c:1.67.2.2
--- src/lib/libcurses/addbytes.c:1.67.2.1	Wed Dec 21 09:38:38 2022
+++ src/lib/libcurses/addbytes.c	Tue Oct 10 13:17:46 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: addbytes.c,v 1.67.2.1 2022/12/21 09:38:38 martin Exp $	*/
+/*	$NetBSD: addbytes.c,v 1.67.2.2 2023/10/10 13:17:46 martin Exp $	*/
 
 /*
  * Copyright (c) 1987, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)addbytes.c	8.4 (Berkeley) 5/4/94";
 #else
-__RCSID("$NetBSD: addbytes.c,v 1.67.2.1 2022/12/21 09:38:38 martin Exp $");
+__RCSID("$NetBSD: addbytes.c,v 1.67.2.2 2023/10/10 13:17:46 martin 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;

Index: src/lib/libcurses/tty.c
diff -u src/lib/libcurses/tty.c:1.49 src/lib/libcurses/tty.c:1.49.2.1
--- src/lib/libcurses/tty.c:1.49	Mon Sep  6 07:03:50 2021
+++ src/lib/libcurses/tty.c	Tue Oct 10 13:17:46 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: tty.c,v 1.49 2021/09/06 07:03:50 rin Exp $	*/
+/*	$NetBSD: tty.c,v 1.49.2.1 2023/10/10 13:17:46 martin 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.49.2.1 2023/10/10 13:17:46 martin Exp $");
 #endif
 #endif				/* not lint */
 
@@ -113,7 +113,7 @@ _cursesi_gettmode(SCREEN *screen)
 
 	if (tcgetattr(fileno(screen->infd), &screen->orig_termios)) {
 		/* if the input fd is not a tty try the output */
-		if (tcgetattr(fileno(screen->infd), &screen->orig_termios)) {
+		if (tcgetattr(fileno(screen->outfd), &screen->orig_termios)) {
 			/* not a tty ... we will disable tty related stuff */
 			screen->notty = TRUE;
 			__GT = 0;

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.4.2.1
--- 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	Tue Oct 10 13:17:46 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.1.2.1
--- 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	Tue Oct 10 13:17:46 2023
@@ -1,3 +1,6 @@
-012345cup5;6X6cup6;8Xel
+  8el
+     012345
+     012345
+     6 el
        8el
      el
\ No newline at end of file

Reply via email to