CVS commit: src/sys/dev/pci/ixgbe

2021-11-16 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Nov 17 06:37:44 UTC 2021

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.h

Log Message:
s/dataseet/datasheet/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.82 -r1.83 src/sys/dev/pci/ixgbe/ixgbe.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/pci/ixgbe/ixgbe.h
diff -u src/sys/dev/pci/ixgbe/ixgbe.h:1.82 src/sys/dev/pci/ixgbe/ixgbe.h:1.83
--- src/sys/dev/pci/ixgbe/ixgbe.h:1.82	Sun Sep 19 10:34:09 2021
+++ src/sys/dev/pci/ixgbe/ixgbe.h	Wed Nov 17 06:37:44 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.h,v 1.82 2021/09/19 10:34:09 andvar Exp $ */
+/* $NetBSD: ixgbe.h,v 1.83 2021/11/17 06:37:44 msaitoh Exp $ */
 
 /**
   SPDX-License-Identifier: BSD-3-Clause
@@ -197,7 +197,7 @@
  * 33 should be large enough even for 64K TSO
  * (32 * 2K mbuf cluster and 1 x mbuf header).
  *
- * Reference: 82599-X550 dataseet 7.2.1.1 "Transmit Storage in System Memory".
+ * Reference: 82599-X550 datasheet 7.2.1.1 "Transmit Storage in System Memory".
  */
 #define IXGBE_82599_SCATTER_MAX	(40 - IXGBE_TX_WTHRESH - 2)
 #define IXGBE_SCATTER_DEFAULT	33



CVS commit: src/sys/dev/pci/ixgbe

2021-11-16 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Nov 17 06:37:44 UTC 2021

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.h

Log Message:
s/dataseet/datasheet/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.82 -r1.83 src/sys/dev/pci/ixgbe/ixgbe.h

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

2021-11-16 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Wed Nov 17 04:33:26 UTC 2021

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

Log Message:
Adjust new libcurses test filenames to the ones atually installed.
Possibly the intent was that the names used here were correct, and
the error is where they're installed - if so, that can be corrected later.

Hopefully this will fix the remaining current build issue.


To generate a diff of this commit:
cvs rdiff -u -r1.1164 -r1.1165 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.1164 src/distrib/sets/lists/tests/mi:1.1165
--- src/distrib/sets/lists/tests/mi:1.1164	Tue Nov 16 21:05:33 2021
+++ src/distrib/sets/lists/tests/mi	Wed Nov 17 04:33:26 2021
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1164 2021/11/16 21:05:33 blymn Exp $
+# $NetBSD: mi,v 1.1165 2021/11/17 04:33:26 kre Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -3460,9 +3460,9 @@
 ./usr/tests/lib/libcurses/check_files/mvwins_wch.chk		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libcurses/check_files/mvwins_wstr1.chk		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libcurses/check_files/mvwins_wstr2.chk		tests-lib-tests		compattestfile,atf
-./usr/tests/lib/libcurses/check_files/mvwins_wstr3.chk		tests-lib-tests		compattestfile,atf
-./usr/tests/lib/libcurses/check_files/mvwins_wstr4.chk		tests-lib-tests		compattestfile,atf
-./usr/tests/lib/libcurses/check_files/mvwins_wstr5.chk		tests-lib-tests		compattestfile,atf
+./usr/tests/lib/libcurses/check_files/wins_wstr3.chk		tests-lib-tests		compattestfile,atf
+./usr/tests/lib/libcurses/check_files/wins_wstr4.chk		tests-lib-tests		compattestfile,atf
+./usr/tests/lib/libcurses/check_files/wins_wstr5.chk		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libcurses/check_files/notimeout.chk		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libcurses/check_files/overlay1.chk		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libcurses/check_files/overlay2.chk		tests-lib-tests		compattestfile,atf



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

2021-11-16 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Wed Nov 17 04:33:26 UTC 2021

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

Log Message:
Adjust new libcurses test filenames to the ones atually installed.
Possibly the intent was that the names used here were correct, and
the error is where they're installed - if so, that can be corrected later.

Hopefully this will fix the remaining current build issue.


To generate a diff of this commit:
cvs rdiff -u -r1.1164 -r1.1165 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/bin/sh

2021-11-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Nov 16 23:39:34 UTC 2021

Modified Files:
src/bin/sh: sh.1

Log Message:
sh.1: fix typos


To generate a diff of this commit:
cvs rdiff -u -r1.237 -r1.238 src/bin/sh/sh.1

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

Modified files:

Index: src/bin/sh/sh.1
diff -u src/bin/sh/sh.1:1.237 src/bin/sh/sh.1:1.238
--- src/bin/sh/sh.1:1.237	Tue Nov 16 11:28:29 2021
+++ src/bin/sh/sh.1	Tue Nov 16 23:39:34 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sh.1,v 1.237 2021/11/16 11:28:29 kre Exp $
+.\"	$NetBSD: sh.1,v 1.238 2021/11/16 23:39:34 rillig Exp $
 .\" Copyright (c) 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
 .\"
@@ -2367,7 +2367,7 @@ be built in for efficiency (e.g.
 .Xr test 1 ,
 etc).
 Most built-in commands will exit with status 2 if used incorrectly
-(bad options, excess or insufficient number of args, etc).
+(bad options, excess or insufficient number of arguments, etc).
 Otherwise, unless stated differently, the built-in commands exit with status 0,
 unless some error occurs, which would be reported to standard error.
 .Bl -tag -width 5n -compact
@@ -2570,7 +2570,7 @@ parameter was specified as
 Concatenate all the
 .Ar string
 arguments with intervening spaces.
-Then parse and execute the command resulting.
+Then parse and execute the resulting command.
 The exit status from
 .Ic eval
 is the exit status of the command executed, or 0 if there was none.
@@ -3026,7 +3026,7 @@ The
 .Fl s ,
 and
 .Fl u
-oprions control which entries are printed.
+options control which entries are printed.
 With
 .Fl f
 functions are printed; with
@@ -3113,11 +3113,11 @@ is not found, the
 .Ic hash
 command will exit with status 1.
 .Pp
-To allow a method to premit backwards compatability with the way
+To allow a method to permit backwards compatibility with the way
 that the
 .Ic hash
 command worked before
-.Nx 10
+.Nx 10 ,
 if both the
 .Fl e
 and



CVS commit: src/bin/sh

2021-11-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Nov 16 23:39:34 UTC 2021

Modified Files:
src/bin/sh: sh.1

Log Message:
sh.1: fix typos


To generate a diff of this commit:
cvs rdiff -u -r1.237 -r1.238 src/bin/sh/sh.1

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



CVS commit: src/lib/libcurses

2021-11-16 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Nov 16 23:23:02 UTC 2021

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

Log Message:
Move 'i' into DEBUG only code (now there be three).
Hopefully unbreaks !DEBUG builds.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/lib/libcurses/ins_wstr.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/ins_wstr.c
diff -u src/lib/libcurses/ins_wstr.c:1.19 src/lib/libcurses/ins_wstr.c:1.20
--- src/lib/libcurses/ins_wstr.c:1.19	Tue Nov 16 21:00:50 2021
+++ src/lib/libcurses/ins_wstr.c	Tue Nov 16 23:23:02 2021
@@ -1,4 +1,4 @@
-/*   $NetBSD: ins_wstr.c,v 1.19 2021/11/16 21:00:50 blymn Exp $ */
+/*   $NetBSD: ins_wstr.c,v 1.20 2021/11/16 23:23:02 kre Exp $ */
 
 /*
  * Copyright (c) 2005 The NetBSD Foundation Inc.
@@ -36,7 +36,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: ins_wstr.c,v 1.19 2021/11/16 21:00:50 blymn Exp $");
+__RCSID("$NetBSD: ins_wstr.c,v 1.20 2021/11/16 23:23:02 kre Exp $");
 #endif		  /* not lint */
 
 #include 
@@ -135,7 +135,7 @@ wins_nwstr(WINDOW *win, const wchar_t *w
 	const wchar_t *scp;
 	cchar_t cc;
 	wchar_t *lstr, *slstr;
-	int i, width, len, lx, sx, x, y, tx, ty, cw, pcw, newx, tn, w;
+	int width, len, lx, sx, x, y, tx, ty, cw, pcw, newx, tn, w;
 	wchar_t ws[] = L"		";
 
 	/* check for leading non-spacing character */
@@ -294,6 +294,8 @@ loopdone:
 			*lnp->firstchp = newx;
 #ifdef DEBUG
 		{
+			int i;
+
 			__CTRACE(__CTRACE_INPUT, "before===\n");
 			for (i = 0; i < win->maxx; i++)
 			__CTRACE(__CTRACE_INPUT,
@@ -334,6 +336,8 @@ loopdone:
 			}
 #ifdef DEBUG
 			{
+int i;
+
 __CTRACE(__CTRACE_INPUT, "=after shift\n");
 for (i = 0; i < win->maxx; i++)
 	__CTRACE(__CTRACE_INPUT,
@@ -363,6 +367,8 @@ loopdone:
 
 #ifdef DEBUG
 		{
+			int i;
+
 			__CTRACE(__CTRACE_INPUT, "lx = %d, x = %x\n", lx, x);
 			__CTRACE(__CTRACE_INPUT, "after===\n");
 			for (i = 0; i < win->maxx; i++)



CVS commit: src/lib/libcurses

2021-11-16 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Nov 16 23:23:02 UTC 2021

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

Log Message:
Move 'i' into DEBUG only code (now there be three).
Hopefully unbreaks !DEBUG builds.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/lib/libcurses/ins_wstr.c

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



CVS commit: src/usr.bin/xlint/lint2

2021-11-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Nov 16 22:12:44 UTC 2021

Modified Files:
src/usr.bin/xlint/lint2: chk.c emit2.c read.c

Log Message:
lint: clean up lint2

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/usr.bin/xlint/lint2/chk.c
cvs rdiff -u -r1.26 -r1.27 src/usr.bin/xlint/lint2/emit2.c
cvs rdiff -u -r1.68 -r1.69 src/usr.bin/xlint/lint2/read.c

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

Modified files:

Index: src/usr.bin/xlint/lint2/chk.c
diff -u src/usr.bin/xlint/lint2/chk.c:1.45 src/usr.bin/xlint/lint2/chk.c:1.46
--- src/usr.bin/xlint/lint2/chk.c:1.45	Sun Aug 29 10:13:02 2021
+++ src/usr.bin/xlint/lint2/chk.c	Tue Nov 16 22:12:44 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: chk.c,v 1.45 2021/08/29 10:13:02 rillig Exp $ */
+/* $NetBSD: chk.c,v 1.46 2021/11/16 22:12:44 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: chk.c,v 1.45 2021/08/29 10:13:02 rillig Exp $");
+__RCSID("$NetBSD: chk.c,v 1.46 2021/11/16 22:12:44 rillig Exp $");
 #endif
 
 #include 
@@ -607,7 +607,7 @@ static void
 printflike(const hte_t *hte, fcall_t *call, int n, const char *fmt, type_t **ap)
 {
 	const	char *fp;
-	int	fc;
+	char	fc;
 	bool	fwidth, prec, left, sign, space, alt, zero;
 	tspec_t	sz, t1, t2 = NOTSPEC;
 	type_t	*tp;
@@ -832,7 +832,7 @@ static void
 scanflike(const hte_t *hte, fcall_t *call, int n, const char *fmt, type_t **ap)
 {
 	const	char *fp;
-	int	fc;
+	char	fc;
 	bool	noasgn, fwidth;
 	tspec_t	sz, t1 = NOTSPEC, t2 = NOTSPEC;
 	type_t	*tp = NULL;

Index: src/usr.bin/xlint/lint2/emit2.c
diff -u src/usr.bin/xlint/lint2/emit2.c:1.26 src/usr.bin/xlint/lint2/emit2.c:1.27
--- src/usr.bin/xlint/lint2/emit2.c:1.26	Sat Sep  4 18:58:57 2021
+++ src/usr.bin/xlint/lint2/emit2.c	Tue Nov 16 22:12:44 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: emit2.c,v 1.26 2021/09/04 18:58:57 rillig Exp $ */
+/* $NetBSD: emit2.c,v 1.27 2021/11/16 22:12:44 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -34,7 +34,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: emit2.c,v 1.26 2021/09/04 18:58:57 rillig Exp $");
+__RCSID("$NetBSD: emit2.c,v 1.27 2021/11/16 22:12:44 rillig Exp $");
 #endif
 
 #include "lint2.h"
@@ -213,7 +213,7 @@ outlib(const char *name)
 	outstrg(name);
 
 	/*
-	 * print the names of all files references by unnamed
+	 * print the names of all files referenced by unnamed
 	 * struct/union/enum declarations.
 	 */
 	outfiles();

Index: src/usr.bin/xlint/lint2/read.c
diff -u src/usr.bin/xlint/lint2/read.c:1.68 src/usr.bin/xlint/lint2/read.c:1.69
--- src/usr.bin/xlint/lint2/read.c:1.68	Tue Nov 16 22:03:12 2021
+++ src/usr.bin/xlint/lint2/read.c	Tue Nov 16 22:12:44 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: read.c,v 1.68 2021/11/16 22:03:12 rillig Exp $ */
+/* $NetBSD: read.c,v 1.69 2021/11/16 22:12:44 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: read.c,v 1.68 2021/11/16 22:03:12 rillig Exp $");
+__RCSID("$NetBSD: read.c,v 1.69 2021/11/16 22:12:44 rillig Exp $");
 #endif
 
 #include 
@@ -102,7 +102,7 @@ static	unsigned short inptype(const char
 static	size_t	gettlen(const char *, const char **);
 static	unsigned short findtype(const char *, size_t, int);
 static	unsigned short storetyp(type_t *, const char *, size_t, int);
-static	int	thash(const char *, size_t);
+static	unsigned int thash(const char *, size_t);
 static	char	*inpqstrg(const char *, const char **);
 static	const	char *inpname(const char *, const char **);
 static	int	getfnidx(const char *);
@@ -980,7 +980,7 @@ storetyp(type_t *tp, const char *cp, siz
 /*
  * Hash function for types
  */
-static int
+static unsigned int
 thash(const char *s, size_t len)
 {
 	unsigned int v;
@@ -1203,7 +1203,7 @@ mkstatic(hte_t *hte)
 	for (symp = >h_syms; (sym = *symp) != NULL; ) {
 		if (sym->s_pos.p_src == sym1->s_pos.p_src) {
 			sym->s_static = true;
-			(*symp) = sym->s_next;
+			*symp = sym->s_next;
 			if (hte->h_lsym == >s_next)
 hte->h_lsym = symp;
 			sym->s_next = NULL;
@@ -1215,7 +1215,7 @@ mkstatic(hte_t *hte)
 	}
 	for (callp = >h_calls; (call = *callp) != NULL; ) {
 		if (call->f_pos.p_src == sym1->s_pos.p_src) {
-			(*callp) = call->f_next;
+			*callp = call->f_next;
 			if (hte->h_lcall == >f_next)
 hte->h_lcall = callp;
 			call->f_next = NULL;
@@ -1227,7 +1227,7 @@ mkstatic(hte_t *hte)
 	}
 	for (usymp = >h_usyms; (usym = *usymp) != NULL; ) {
 		if (usym->u_pos.p_src == sym1->s_pos.p_src) {
-			(*usymp) = usym->u_next;
+			*usymp = usym->u_next;
 			if (hte->h_lusym == >u_next)
 hte->h_lusym = usymp;
 			usym->u_next = NULL;



CVS commit: src/usr.bin/xlint/lint2

2021-11-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Nov 16 22:12:44 UTC 2021

Modified Files:
src/usr.bin/xlint/lint2: chk.c emit2.c read.c

Log Message:
lint: clean up lint2

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/usr.bin/xlint/lint2/chk.c
cvs rdiff -u -r1.26 -r1.27 src/usr.bin/xlint/lint2/emit2.c
cvs rdiff -u -r1.68 -r1.69 src/usr.bin/xlint/lint2/read.c

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



CVS commit: src/usr.bin/xlint/lint2

2021-11-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Nov 16 22:03:12 UTC 2021

Modified Files:
src/usr.bin/xlint/lint2: externs2.h hash.c main2.c read.c

Log Message:
lint: clean up initialization of lint2 symbol table

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/usr.bin/xlint/lint2/externs2.h
cvs rdiff -u -r1.22 -r1.23 src/usr.bin/xlint/lint2/hash.c \
src/usr.bin/xlint/lint2/main2.c
cvs rdiff -u -r1.67 -r1.68 src/usr.bin/xlint/lint2/read.c

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

Modified files:

Index: src/usr.bin/xlint/lint2/externs2.h
diff -u src/usr.bin/xlint/lint2/externs2.h:1.15 src/usr.bin/xlint/lint2/externs2.h:1.16
--- src/usr.bin/xlint/lint2/externs2.h:1.15	Sun Sep  5 18:17:15 2021
+++ src/usr.bin/xlint/lint2/externs2.h	Tue Nov 16 22:03:12 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: externs2.h,v 1.15 2021/09/05 18:17:15 rillig Exp $ */
+/* $NetBSD: externs2.h,v 1.16 2021/11/16 22:03:12 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -48,13 +48,13 @@ extern	bool	Fflag;
 /*
  * hash.c
  */
-extern	void	_inithash(hte_t ***);
+extern	hte_t**	htab_new(void);
 extern	hte_t	*_hsearch(hte_t **, const char *, bool);
+extern	void	symtab_init(void);
 extern	void	symtab_forall(void (*)(hte_t *));
-extern	void	_destroyhash(hte_t **);
 extern	void	symtab_forall_sorted(void (*)(hte_t *));
+extern	void	_destroyhash(hte_t **);
 
-#define	inithash()	_inithash(NULL);
 #define	hsearch(a, b)	_hsearch(NULL, (a), (b))
 
 /*

Index: src/usr.bin/xlint/lint2/hash.c
diff -u src/usr.bin/xlint/lint2/hash.c:1.22 src/usr.bin/xlint/lint2/hash.c:1.23
--- src/usr.bin/xlint/lint2/hash.c:1.22	Sat Aug 28 21:52:14 2021
+++ src/usr.bin/xlint/lint2/hash.c	Tue Nov 16 22:03:12 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: hash.c,v 1.22 2021/08/28 21:52:14 rillig Exp $	*/
+/*	$NetBSD: hash.c,v 1.23 2021/11/16 22:03:12 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: hash.c,v 1.22 2021/08/28 21:52:14 rillig Exp $");
+__RCSID("$NetBSD: hash.c,v 1.23 2021/11/16 22:03:12 rillig Exp $");
 #endif
 
 /*
@@ -57,14 +57,10 @@ static	hte_t	**htab;
 /*
  * Initialize hash table.
  */
-void
-_inithash(hte_t ***tablep)
+hte_t **
+htab_new(void)
 {
-
-	if (tablep == NULL)
-		tablep = 
-
-	*tablep = xcalloc(HSHSIZ2, sizeof(**tablep));
+	return xcalloc(HSHSIZ2, sizeof(*htab_new()));
 }
 
 /*
@@ -151,6 +147,12 @@ hte_by_name(const void *va, const void *
 	return strcmp(a->h_name, b->h_name);
 }
 
+void
+symtab_init(void)
+{
+	htab = htab_new();
+}
+
 /*
  * Call the action for each name in the hash table.
  */
Index: src/usr.bin/xlint/lint2/main2.c
diff -u src/usr.bin/xlint/lint2/main2.c:1.22 src/usr.bin/xlint/lint2/main2.c:1.23
--- src/usr.bin/xlint/lint2/main2.c:1.22	Sun Sep  5 18:17:15 2021
+++ src/usr.bin/xlint/lint2/main2.c	Tue Nov 16 22:03:12 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: main2.c,v 1.22 2021/09/05 18:17:15 rillig Exp $	*/
+/*	$NetBSD: main2.c,v 1.23 2021/11/16 22:03:12 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: main2.c,v 1.22 2021/09/05 18:17:15 rillig Exp $");
+__RCSID("$NetBSD: main2.c,v 1.23 2021/11/16 22:03:12 rillig Exp $");
 #endif
 
 #include 
@@ -155,8 +155,7 @@ main(int argc, char *argv[])
 
 	initmem();
 
-	/* initialize hash table */
-	inithash();
+	symtab_init();
 
 	for (i = 0; i < argc; i++)
 		readfile(argv[i]);

Index: src/usr.bin/xlint/lint2/read.c
diff -u src/usr.bin/xlint/lint2/read.c:1.67 src/usr.bin/xlint/lint2/read.c:1.68
--- src/usr.bin/xlint/lint2/read.c:1.67	Sun Sep  5 19:58:53 2021
+++ src/usr.bin/xlint/lint2/read.c	Tue Nov 16 22:03:12 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: read.c,v 1.67 2021/09/05 19:58:53 rillig Exp $ */
+/* $NetBSD: read.c,v 1.68 2021/11/16 22:03:12 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: read.c,v 1.67 2021/09/05 19:58:53 rillig Exp $");
+__RCSID("$NetBSD: read.c,v 1.68 2021/11/16 22:03:12 rillig Exp $");
 #endif
 
 #include 
@@ -223,7 +223,7 @@ readfile(const char *name)
 	if (thtab == NULL)
 		thtab = xcalloc(THSHSIZ2, sizeof(*thtab));
 
-	_inithash();
+	renametab = htab_new();
 
 	srcfile = getfnidx(name);
 



CVS commit: src/usr.bin/xlint/lint2

2021-11-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Nov 16 22:03:12 UTC 2021

Modified Files:
src/usr.bin/xlint/lint2: externs2.h hash.c main2.c read.c

Log Message:
lint: clean up initialization of lint2 symbol table

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/usr.bin/xlint/lint2/externs2.h
cvs rdiff -u -r1.22 -r1.23 src/usr.bin/xlint/lint2/hash.c \
src/usr.bin/xlint/lint2/main2.c
cvs rdiff -u -r1.67 -r1.68 src/usr.bin/xlint/lint2/read.c

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



CVS commit: src/bin/echo

2021-11-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Nov 16 21:38:29 UTC 2021

Modified Files:
src/bin/echo: echo.c

Log Message:
echo: fix lint error due to strict bool mode

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/bin/echo/echo.c

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

Modified files:

Index: src/bin/echo/echo.c
diff -u src/bin/echo/echo.c:1.22 src/bin/echo/echo.c:1.23
--- src/bin/echo/echo.c:1.22	Wed Nov 10 17:35:45 2021
+++ src/bin/echo/echo.c	Tue Nov 16 21:38:29 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: echo.c,v 1.22 2021/11/10 17:35:45 kre Exp $	*/
+/* $NetBSD: echo.c,v 1.23 2021/11/16 21:38:29 rillig Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -37,7 +37,7 @@ __COPYRIGHT(
 #if 0
 static char sccsid[] = "@(#)echo.c	8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: echo.c,v 1.22 2021/11/10 17:35:45 kre Exp $");
+__RCSID("$NetBSD: echo.c,v 1.23 2021/11/16 21:38:29 rillig Exp $");
 #endif
 
 #include 
@@ -68,8 +68,8 @@ main(int argc, char *argv[])
 	}
 	if (!nflag)
 		(void)putchar('\n');
-	fflush(stdout);
-	if (ferror(stdout))
+	(void)fflush(stdout);
+	if (ferror(stdout) != 0)
 		err(1, "write error");
 	return 0;
 }



CVS commit: src/bin/echo

2021-11-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Nov 16 21:38:29 UTC 2021

Modified Files:
src/bin/echo: echo.c

Log Message:
echo: fix lint error due to strict bool mode

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/bin/echo/echo.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

2021-11-16 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue Nov 16 21:05:33 UTC 2021

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

Log Message:
Add more check files for libcurses tests.


To generate a diff of this commit:
cvs rdiff -u -r1.1163 -r1.1164 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.1163 src/distrib/sets/lists/tests/mi:1.1164
--- src/distrib/sets/lists/tests/mi:1.1163	Mon Nov 15 06:34:05 2021
+++ src/distrib/sets/lists/tests/mi	Tue Nov 16 21:05:33 2021
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1163 2021/11/15 06:34:05 blymn Exp $
+# $NetBSD: mi,v 1.1164 2021/11/16 21:05:33 blymn Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -3386,6 +3386,9 @@
 ./usr/tests/lib/libcurses/check_files/ins_wch3.chk		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libcurses/check_files/ins_wstr1.chk		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libcurses/check_files/ins_wstr2.chk		tests-lib-tests		compattestfile,atf
+./usr/tests/lib/libcurses/check_files/ins_wstr3.chk		tests-lib-tests		compattestfile,atf
+./usr/tests/lib/libcurses/check_files/ins_wstr4.chk		tests-lib-tests		compattestfile,atf
+./usr/tests/lib/libcurses/check_files/ins_wstr5.chk		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libcurses/check_files/insch.chk			tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libcurses/check_files/insch1.chk		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libcurses/check_files/insch2.chk		tests-lib-tests		compattestfile,atf
@@ -3457,6 +3460,9 @@
 ./usr/tests/lib/libcurses/check_files/mvwins_wch.chk		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libcurses/check_files/mvwins_wstr1.chk		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libcurses/check_files/mvwins_wstr2.chk		tests-lib-tests		compattestfile,atf
+./usr/tests/lib/libcurses/check_files/mvwins_wstr3.chk		tests-lib-tests		compattestfile,atf
+./usr/tests/lib/libcurses/check_files/mvwins_wstr4.chk		tests-lib-tests		compattestfile,atf
+./usr/tests/lib/libcurses/check_files/mvwins_wstr5.chk		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libcurses/check_files/notimeout.chk		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libcurses/check_files/overlay1.chk		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libcurses/check_files/overlay2.chk		tests-lib-tests		compattestfile,atf



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

2021-11-16 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue Nov 16 21:05:33 UTC 2021

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

Log Message:
Add more check files for libcurses tests.


To generate a diff of this commit:
cvs rdiff -u -r1.1163 -r1.1164 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

2021-11-16 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue Nov 16 21:02:06 UTC 2021

Modified Files:
src/tests/lib/libcurses/check_files: Makefile
src/tests/lib/libcurses/tests: ins_wstr wins_wstr
Added Files:
src/tests/lib/libcurses/check_files: ins_wstr3.chk ins_wstr4.chk
ins_wstr5.chk wins_wstr3.chk wins_wstr4.chk wins_wstr5.chk

Log Message:
Add more testing for special character handling in ins_wstr family.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/tests/lib/libcurses/check_files/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/libcurses/check_files/ins_wstr3.chk \
src/tests/lib/libcurses/check_files/ins_wstr4.chk \
src/tests/lib/libcurses/check_files/ins_wstr5.chk \
src/tests/lib/libcurses/check_files/wins_wstr3.chk \
src/tests/lib/libcurses/check_files/wins_wstr4.chk \
src/tests/lib/libcurses/check_files/wins_wstr5.chk
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libcurses/tests/ins_wstr \
src/tests/lib/libcurses/tests/wins_wstr

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.8 src/tests/lib/libcurses/check_files/Makefile:1.9
--- src/tests/lib/libcurses/check_files/Makefile:1.8	Mon Nov 15 06:31:21 2021
+++ src/tests/lib/libcurses/check_files/Makefile	Tue Nov 16 21:02:06 2021
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.8 2021/11/15 06:31:21 blymn Exp $
+# $NetBSD: Makefile,v 1.9 2021/11/16 21:02:06 blymn Exp $
 
 NOMAN=		# defined
 
@@ -122,6 +122,9 @@ FILES+=		ins_wch2.chk
 FILES+=		ins_wch3.chk
 FILES+=		ins_wstr1.chk
 FILES+=		ins_wstr2.chk
+FILES+=		ins_wstr3.chk
+FILES+=		ins_wstr4.chk
+FILES+=		ins_wstr5.chk
 FILES+=		insch.chk
 FILES+=		insch1.chk
 FILES+=		insch2.chk
@@ -264,6 +267,9 @@ FILES+=		wins_nwstr1.chk
 FILES+=		wins_nwstr2.chk
 FILES+=		wins_wstr1.chk
 FILES+=		wins_wstr2.chk
+FILES+=		wins_wstr3.chk
+FILES+=		wins_wstr4.chk
+FILES+=		wins_wstr5.chk
 FILES+=		winsch1.chk
 FILES+=		winsch2.chk
 FILES+=		wprintw_refresh.chk

Index: src/tests/lib/libcurses/tests/ins_wstr
diff -u src/tests/lib/libcurses/tests/ins_wstr:1.1 src/tests/lib/libcurses/tests/ins_wstr:1.2
--- src/tests/lib/libcurses/tests/ins_wstr:1.1	Sat Oct 24 04:46:17 2020
+++ src/tests/lib/libcurses/tests/ins_wstr	Tue Nov 16 21:02:06 2021
@@ -20,9 +20,25 @@ call OK refresh
 call2 10 10 getyx STDSCR
 compare ins_wstr2.chk
 
-# lib/55433: Bug in special character handling of ins_wstr() of libcurses
-# test special character processing [FAILING]
-# wchar NSTR ["A"*3, "\r", "B"*2]
-# call OK move 20 0
-# call OK ins_wstr $NSTR
-# call OK refresh
+# This should result in just BB
+wchar NSTR ["A"*3, "\r", "B"*2]
+call OK move 20 0
+call OK ins_wstr $NSTR
+call OK refresh
+compare ins_wstr3.chk
+
+# Check handling of tabs
+# first try inserting too many, it should fail
+wchar TSTR [ "\t"*20 ]
+call ERR ins_wstr $TSTR
+call OK refresh
+call2 20 0 getyx STDSCR
+compare ins_wstr4.chk
+
+# Now insert a few tabs...
+wchar USTR [ "F", "\t"*3, "F" ]
+call OK ins_wstr $USTR
+call OK refresh
+call2 20 0 getyx STDSCR
+compare ins_wstr5.chk
+
Index: src/tests/lib/libcurses/tests/wins_wstr
diff -u src/tests/lib/libcurses/tests/wins_wstr:1.1 src/tests/lib/libcurses/tests/wins_wstr:1.2
--- src/tests/lib/libcurses/tests/wins_wstr:1.1	Sat Oct 24 04:46:17 2020
+++ src/tests/lib/libcurses/tests/wins_wstr	Tue Nov 16 21:02:06 2021
@@ -16,3 +16,35 @@ call OK wins_wstr $win1 $NSTR
 call OK wrefresh $win1
 call2 4 1 getyx $win1
 compare wins_wstr2.chk
+
+#
+# test the special character handling.
+#
+# handling of a carriage return
+wchar RSTR ["B", "\r", "C" ]
+call OK wmove $win1 5 1
+call OK wins_wstr $win1 $RSTR
+call OK wrefresh $win1
+call2 5 1 getyx $win1
+compare wins_wstr3.chk
+
+# handling of a newline
+wchar JSTR [ "D", "\n", "E" ]
+call OK wmove $win1 5 1
+# this should fail since scrollok is false
+call OK scrollok $win1 $FALSE
+call ERR wins_wstr $win1 $JSTR
+
+# try again after enabling scroll
+call OK scrollok $win1 $TRUE
+call OK wins_wstr $win1 $JSTR
+call OK wrefresh $win1
+call2 5 1 getyx $win1
+compare wins_wstr4.chk
+
+# handling of a backspace
+wchar BSTR [ "F"*3, "\b", "G"*2 ]
+call OK wins_wstr $win1 $BSTR
+call OK wrefresh $win1
+call2 5 1 getyx $win1
+compare wins_wstr5.chk

Added files:

Index: src/tests/lib/libcurses/check_files/ins_wstr3.chk
diff -u /dev/null src/tests/lib/libcurses/check_files/ins_wstr3.chk:1.1
--- /dev/null	Tue Nov 16 21:02:06 2021
+++ src/tests/lib/libcurses/check_files/ins_wstr3.chk	Tue Nov 16 21:02:06 2021
@@ -0,0 +1 @@
+cup21;1XBB
\ No newline at end of file
Index: src/tests/lib/libcurses/check_files/ins_wstr5.chk
diff -u /dev/null src/tests/lib/libcurses/check_files/ins_wstr5.chk:1.1
--- /dev/null	Tue Nov 16 21:02:06 2021
+++ src/tests/lib/libcurses/check_files/ins_wstr5.chk	Tue Nov 16 21:02:06 2021
@@ -0,0 +1 @@
+F			F
\ No newline at end 

CVS commit: src/tests/lib/libcurses

2021-11-16 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue Nov 16 21:02:06 UTC 2021

Modified Files:
src/tests/lib/libcurses/check_files: Makefile
src/tests/lib/libcurses/tests: ins_wstr wins_wstr
Added Files:
src/tests/lib/libcurses/check_files: ins_wstr3.chk ins_wstr4.chk
ins_wstr5.chk wins_wstr3.chk wins_wstr4.chk wins_wstr5.chk

Log Message:
Add more testing for special character handling in ins_wstr family.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/tests/lib/libcurses/check_files/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/libcurses/check_files/ins_wstr3.chk \
src/tests/lib/libcurses/check_files/ins_wstr4.chk \
src/tests/lib/libcurses/check_files/ins_wstr5.chk \
src/tests/lib/libcurses/check_files/wins_wstr3.chk \
src/tests/lib/libcurses/check_files/wins_wstr4.chk \
src/tests/lib/libcurses/check_files/wins_wstr5.chk
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libcurses/tests/ins_wstr \
src/tests/lib/libcurses/tests/wins_wstr

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



CVS commit: src

2021-11-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Nov 16 21:01:06 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: d_c99_bool_strict.c
d_c99_bool_strict.exp
src/usr.bin/xlint/lint1: cgram.y ckbool.c debug.c externs1.h func.c
init.c lint1.h mem1.c tree.c

Log Message:
lint: fix check for function calls in strict bool mode

Previously, if a function call occurred in the controlling expression,
its return type could be any scalar, not just bool.  This was against
the goal of strict bool mode, which makes bool a separate and
incompabile type to all other types.  For example, it would allow
controlling expressions like 'strcmp(a, b)' without the usual '!= 0',
but only if at least one of 'a' and 'b' came from a macro definition
from a system header.

The fix is that the decision of whether the type of the controlling
expression may be scalar is no longer based on the operand types but on
the main operator of the controlling expression.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c
cvs rdiff -u -r1.31 -r1.32 \
src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.exp
cvs rdiff -u -r1.369 -r1.370 src/usr.bin/xlint/lint1/cgram.y
cvs rdiff -u -r1.8 -r1.9 src/usr.bin/xlint/lint1/ckbool.c
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/xlint/lint1/debug.c
cvs rdiff -u -r1.139 -r1.140 src/usr.bin/xlint/lint1/externs1.h
cvs rdiff -u -r1.125 -r1.126 src/usr.bin/xlint/lint1/func.c
cvs rdiff -u -r1.209 -r1.210 src/usr.bin/xlint/lint1/init.c
cvs rdiff -u -r1.130 -r1.131 src/usr.bin/xlint/lint1/lint1.h
cvs rdiff -u -r1.54 -r1.55 src/usr.bin/xlint/lint1/mem1.c
cvs rdiff -u -r1.394 -r1.395 src/usr.bin/xlint/lint1/tree.c

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



CVS commit: src

2021-11-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Nov 16 21:01:06 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: d_c99_bool_strict.c
d_c99_bool_strict.exp
src/usr.bin/xlint/lint1: cgram.y ckbool.c debug.c externs1.h func.c
init.c lint1.h mem1.c tree.c

Log Message:
lint: fix check for function calls in strict bool mode

Previously, if a function call occurred in the controlling expression,
its return type could be any scalar, not just bool.  This was against
the goal of strict bool mode, which makes bool a separate and
incompabile type to all other types.  For example, it would allow
controlling expressions like 'strcmp(a, b)' without the usual '!= 0',
but only if at least one of 'a' and 'b' came from a macro definition
from a system header.

The fix is that the decision of whether the type of the controlling
expression may be scalar is no longer based on the operand types but on
the main operator of the controlling expression.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c
cvs rdiff -u -r1.31 -r1.32 \
src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.exp
cvs rdiff -u -r1.369 -r1.370 src/usr.bin/xlint/lint1/cgram.y
cvs rdiff -u -r1.8 -r1.9 src/usr.bin/xlint/lint1/ckbool.c
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/xlint/lint1/debug.c
cvs rdiff -u -r1.139 -r1.140 src/usr.bin/xlint/lint1/externs1.h
cvs rdiff -u -r1.125 -r1.126 src/usr.bin/xlint/lint1/func.c
cvs rdiff -u -r1.209 -r1.210 src/usr.bin/xlint/lint1/init.c
cvs rdiff -u -r1.130 -r1.131 src/usr.bin/xlint/lint1/lint1.h
cvs rdiff -u -r1.54 -r1.55 src/usr.bin/xlint/lint1/mem1.c
cvs rdiff -u -r1.394 -r1.395 src/usr.bin/xlint/lint1/tree.c

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

Modified files:

Index: src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c
diff -u src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c:1.33 src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c:1.34
--- src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c:1.33	Tue Nov 16 18:27:04 2021
+++ src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c	Tue Nov 16 21:01:06 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: d_c99_bool_strict.c,v 1.33 2021/11/16 18:27:04 rillig Exp $	*/
+/*	$NetBSD: d_c99_bool_strict.c,v 1.34 2021/11/16 21:01:06 rillig Exp $	*/
 # 3 "d_c99_bool_strict.c"
 
 /*
@@ -783,8 +783,8 @@ initialization(void)
  * though they are not strictly boolean.
  *
  * This shouldn't apply to function call expressions though since one of the
- * goals of strict bool mode is to normalize all expressions like 'strcmp' to
- * be 'strcmp(a, b) == 0' instead of '!strcmp(a, b)'.
+ * goals of strict bool mode is to normalize all expressions calling 'strcmp'
+ * to be of the form 'strcmp(a, b) == 0' instead of '!strcmp(a, b)'.
  */
 # 1 "stdio.h" 1 3 4
 typedef struct stdio_file {
@@ -815,68 +815,83 @@ controlling_expression(FILE *f, const ch
 		return;
 
 	/*
-	 * No warning below since the expression 'stdio_stdin' comes from a
-	 * system header (typically via a macro), and this property is passed
-	 * up to the expression 'ferror(stdio_stdin)'.
+	 * Before tree.c 1.395 from 2021-11-16, the expression below didn't
+	 * produce a warning since the expression 'stdio_stdin' didn't come
+	 * from a system header (typically via a macro), and this property
+	 * was passed up to the expression 'ferror(stdio_stdin)'.
 	 *
-	 * That is wrong though since the above rule would allow a plain
-	 * 'strcmp' without a following '== 0', as long as one of its
-	 * arguments comes from a system header.
+	 * That was wrong though since the type of a function call expression
+	 * only depends on the function itself but not its arguments types.
+	 * The old rule had allowed a raw condition 'strcmp(a, b)' without
+	 * the comparison '!= 0', as long as one of its arguments came from a
+	 * system header.
 	 *
 	 * Seen in bin/echo/echo.c, function main, call to ferror.
 	 */
-	/*
-	 * TODO: In a function call expression, tn->tn_relaxed should only be
-	 * derived from the function itself, not from its arguments.
-	 */
-	/* TODO: Warn about type mismatch [333]. */
+	/* expect+5: error: controlling expression must be bool, not 'int' [333] */
 	if (ferror(
-# 835 "d_c99_bool_strict.c" 3 4
+# 834 "d_c99_bool_strict.c" 3 4
 	_files[1]
-# 837 "d_c99_bool_strict.c"
+# 836 "d_c99_bool_strict.c"
 	))
 		return;
 
 	/*
 	 * Before cgram.y 1.369 from 2021-11-16, at the end of parsing the
 	 * name 'stdio_stdout', the parser already looked ahead to the next
-	 * token, to see whether it was the '(' of a function call.  At that
-	 * point, the parser was no longer in a system header, therefore
-	 * 'stdio_stdout' was not tn_relaxed, and this information was pushed
-	 * down to the whole function call expression (which was another bug
-	 * at that time).
+	 * token, to see whether it was the '(' of a function call.
+	 *
+	 * At that point, the parser 

CVS commit: src/lib/libcurses

2021-11-16 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue Nov 16 21:00:50 UTC 2021

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

Log Message:
Fix handling of the tab special character.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/lib/libcurses/ins_wstr.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/ins_wstr.c
diff -u src/lib/libcurses/ins_wstr.c:1.18 src/lib/libcurses/ins_wstr.c:1.19
--- src/lib/libcurses/ins_wstr.c:1.18	Mon Nov 15 06:27:06 2021
+++ src/lib/libcurses/ins_wstr.c	Tue Nov 16 21:00:50 2021
@@ -1,4 +1,4 @@
-/*   $NetBSD: ins_wstr.c,v 1.18 2021/11/15 06:27:06 blymn Exp $ */
+/*   $NetBSD: ins_wstr.c,v 1.19 2021/11/16 21:00:50 blymn Exp $ */
 
 /*
  * Copyright (c) 2005 The NetBSD Foundation Inc.
@@ -36,7 +36,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: ins_wstr.c,v 1.18 2021/11/15 06:27:06 blymn Exp $");
+__RCSID("$NetBSD: ins_wstr.c,v 1.19 2021/11/16 21:00:50 blymn Exp $");
 #endif		  /* not lint */
 
 #include 
@@ -194,9 +194,12 @@ wins_nwstr(WINDOW *win, const wchar_t *w
 continue;
 
 			case L'\t':
-w = min(win->maxx - x, TABSIZE - (x % TABSIZE));
-width += w * wcwidth(ws[0]);
-x += w * wcwidth(ws[0]);
+cw = wcwidth(ws[0]);
+if (cw < 0)
+	cw = 1;
+w = cw * (TABSIZE - (x % TABSIZE));
+width += w;
+x += w;
 scp++;
 continue;
 		}
@@ -254,16 +257,16 @@ wins_nwstr(WINDOW *win, const wchar_t *w
 	break;
 
 case L'\t':
-	w = min(win->maxx - x,
-	TABSIZE - (x % TABSIZE));
-	width += w * wcwidth(ws[0]);
-	x += w * wcwidth(ws[0]);
+	cw = wcwidth(ws[0]);
+	if (cw < 0)
+		cw = 1;
+	w = cw * (TABSIZE - (x % TABSIZE));
+	width += w;
+	x += w;
 	len += w;
 	scp++;
-	for (i = 0; i < w; i++ ) {
-		*lstr = *ws;
-		lstr++;
-	}
+	*lstr = *ws;
+	lstr++;
 	continue;
 			}
 			w = wcwidth(*scp);



CVS commit: src/lib/libcurses

2021-11-16 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue Nov 16 21:00:50 UTC 2021

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

Log Message:
Fix handling of the tab special character.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/lib/libcurses/ins_wstr.c

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



CVS commit: src/games/caesar

2021-11-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Nov 16 20:42:47 UTC 2021

Modified Files:
src/games/caesar: caesar.c

Log Message:
games/caesar: fix error handling for I/O

The '!= 0' is needed for an upcoming fix to lint's strict bool mode.

The additional text in the error messages is necessary because errx only
outputs the given string, with no details from errno.  Since ferror does
not set errno, no such details are available, so just output a generic
message, which is still better than just "caesar: ".


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/games/caesar/caesar.c

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

Modified files:

Index: src/games/caesar/caesar.c
diff -u src/games/caesar/caesar.c:1.23 src/games/caesar/caesar.c:1.24
--- src/games/caesar/caesar.c:1.23	Sat May  1 20:21:25 2021
+++ src/games/caesar/caesar.c	Tue Nov 16 20:42:47 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: caesar.c,v 1.23 2021/05/01 20:21:25 rillig Exp $	*/
+/*	$NetBSD: caesar.c,v 1.24 2021/11/16 20:42:47 rillig Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -48,7 +48,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 19
 #if 0
 static char sccsid[] = "@(#)caesar.c	8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: caesar.c,v 1.23 2021/05/01 20:21:25 rillig Exp $");
+__RCSID("$NetBSD: caesar.c,v 1.24 2021/11/16 20:42:47 rillig Exp $");
 #endif
 #endif /* not lint */
 
@@ -203,14 +203,14 @@ main(int argc, char **argv)
 		/* NOTREACHED */
 	}
 
-	if (ferror(stdin)) {
-		errx(EXIT_FAILURE, "");
+	if (ferror(stdin) != 0) {
+		errx(EXIT_FAILURE, ": read error");
 		/* NOTREACHED */
 	}
 
 	(void)fflush(stdout);
-	if (ferror(stdout)) {
-		errx(EXIT_FAILURE, "");
+	if (ferror(stdout) != 0) {
+		errx(EXIT_FAILURE, ": write error");
 		/* NOTREACHED */
 	}
 



CVS commit: src/games/caesar

2021-11-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Nov 16 20:42:47 UTC 2021

Modified Files:
src/games/caesar: caesar.c

Log Message:
games/caesar: fix error handling for I/O

The '!= 0' is needed for an upcoming fix to lint's strict bool mode.

The additional text in the error messages is necessary because errx only
outputs the given string, with no details from errno.  Since ferror does
not set errno, no such details are available, so just output a generic
message, which is still better than just "caesar: ".


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/games/caesar/caesar.c

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



CVS commit: src/usr.bin/xlint/lint1

2021-11-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Nov 16 18:37:24 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: mem1.c

Log Message:
lint: remove outdated comment

The bug has been fixed in cgram.y 1.369 a few minutes ago.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/usr.bin/xlint/lint1/mem1.c

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

Modified files:

Index: src/usr.bin/xlint/lint1/mem1.c
diff -u src/usr.bin/xlint/lint1/mem1.c:1.53 src/usr.bin/xlint/lint1/mem1.c:1.54
--- src/usr.bin/xlint/lint1/mem1.c:1.53	Tue Nov 16 06:55:03 2021
+++ src/usr.bin/xlint/lint1/mem1.c	Tue Nov 16 18:37:24 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: mem1.c,v 1.53 2021/11/16 06:55:03 rillig Exp $	*/
+/*	$NetBSD: mem1.c,v 1.54 2021/11/16 18:37:24 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: mem1.c,v 1.53 2021/11/16 06:55:03 rillig Exp $");
+__RCSID("$NetBSD: mem1.c,v 1.54 2021/11/16 18:37:24 rillig Exp $");
 #endif
 
 #include 
@@ -364,11 +364,6 @@ expr_zalloc_tnode(void)
 	 * typically contain generated code that cannot be influenced, such
 	 * as a flex lexer or a yacc parser.
 	 */
-	/*
-	 * FIXME: At this point, it is too late to check in_system_header.
-	 * That must already be done at the beginning of the token.
-	 * See the test d_c99_bool_strict.c, 'stdio_stdout'.
-	 */
 	tn->tn_relaxed = in_system_header ||
 			 (curr_pos.p_file != csrc_pos.p_file &&
 			  str_endswith(curr_pos.p_file, ".c"));



CVS commit: src/usr.bin/xlint/lint1

2021-11-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Nov 16 18:37:24 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: mem1.c

Log Message:
lint: remove outdated comment

The bug has been fixed in cgram.y 1.369 a few minutes ago.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/usr.bin/xlint/lint1/mem1.c

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



CVS commit: src/usr.bin/xlint/lint1

2021-11-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Nov 16 18:33:14 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: lex.c

Log Message:
lint: finish renaming of fcon to lex_floating_constant


To generate a diff of this commit:
cvs rdiff -u -r1.86 -r1.87 src/usr.bin/xlint/lint1/lex.c

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

Modified files:

Index: src/usr.bin/xlint/lint1/lex.c
diff -u src/usr.bin/xlint/lint1/lex.c:1.86 src/usr.bin/xlint/lint1/lex.c:1.87
--- src/usr.bin/xlint/lint1/lex.c:1.86	Tue Nov 16 17:41:23 2021
+++ src/usr.bin/xlint/lint1/lex.c	Tue Nov 16 18:33:14 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: lex.c,v 1.86 2021/11/16 17:41:23 rillig Exp $ */
+/* $NetBSD: lex.c,v 1.87 2021/11/16 18:33:14 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: lex.c,v 1.86 2021/11/16 17:41:23 rillig Exp $");
+__RCSID("$NetBSD: lex.c,v 1.87 2021/11/16 18:33:14 rillig Exp $");
 #endif
 
 #include 
@@ -669,9 +669,9 @@ convert_integer(int64_t q, tspec_t t, un
 }
 
 /*
- * Convert a string representing a floating point value into its integral
- * representation. Type and value are returned in yylval. fcon()
- * (and yylex()) returns T_CON.
+ * Convert a string representing a floating point value into its numerical
+ * representation. Type and value are returned in yylval.
+ *
  * XXX Currently it is not possible to convert constants of type
  * long double which are greater than DBL_MAX.
  */
@@ -725,7 +725,8 @@ lex_floating_constant(const char *yytext
 			errno = 0;
 			break;
 		default:
-			INTERNAL_ERROR("fcon(%s->%s)", cp, eptr);
+			INTERNAL_ERROR("lex_floating_constant(%s->%s)",
+			cp, eptr);
 		}
 	}
 	if (errno != 0)



CVS commit: src/usr.bin/xlint/lint1

2021-11-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Nov 16 18:33:14 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: lex.c

Log Message:
lint: finish renaming of fcon to lex_floating_constant


To generate a diff of this commit:
cvs rdiff -u -r1.86 -r1.87 src/usr.bin/xlint/lint1/lex.c

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



CVS commit: src

2021-11-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Nov 16 18:27:04 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: d_c99_bool_strict.c
d_c99_bool_strict.exp
src/usr.bin/xlint/lint1: cgram.y

Log Message:
lint: fix wrong error message in strict bool mode

This fix only affects the last token before a macro, as well as the last
token in the expanded macro.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c
cvs rdiff -u -r1.30 -r1.31 \
src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.exp
cvs rdiff -u -r1.368 -r1.369 src/usr.bin/xlint/lint1/cgram.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/usr.bin/xlint/lint1/d_c99_bool_strict.c
diff -u src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c:1.32 src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c:1.33
--- src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c:1.32	Tue Nov 16 06:55:03 2021
+++ src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c	Tue Nov 16 18:27:04 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: d_c99_bool_strict.c,v 1.32 2021/11/16 06:55:03 rillig Exp $	*/
+/*	$NetBSD: d_c99_bool_strict.c,v 1.33 2021/11/16 18:27:04 rillig Exp $	*/
 # 3 "d_c99_bool_strict.c"
 
 /*
@@ -838,14 +838,14 @@ controlling_expression(FILE *f, const ch
 		return;
 
 	/*
-	 * FIXME: At the end of parsing the name 'stdio_stdout', the parser
-	 * has already looked ahead to the next token, to see whether it is
-	 * a '(' of a function call.  At that point, the parser is no longer
-	 * in a system header, therefore 'stdio_stdout' is not tn_relaxed,
-	 * and this information is pushed down to the whole function call
-	 * expression.
+	 * Before cgram.y 1.369 from 2021-11-16, at the end of parsing the
+	 * name 'stdio_stdout', the parser already looked ahead to the next
+	 * token, to see whether it was the '(' of a function call.  At that
+	 * point, the parser was no longer in a system header, therefore
+	 * 'stdio_stdout' was not tn_relaxed, and this information was pushed
+	 * down to the whole function call expression (which was another bug
+	 * at that time).
 	 */
-	/* expect+5: error: controlling expression must be bool, not 'int' [333] */
 	if (ferror(
 # 851 "d_c99_bool_strict.c" 3 4
 	stdio_stdout
@@ -867,12 +867,12 @@ controlling_expression(FILE *f, const ch
 		return;
 
 	/*
-	 * A comment following 'stdio_stdout' does not prevent the search for
-	 * '('.  At the point where build_name calls expr_zalloc_tnode, the
-	 * parser is already in the main file again, thus treating
-	 * stdio_stdout as not coming from a system header.
+	 * Before cgram.y 1.369 from 2021-11-16, the comment following
+	 * 'stdio_stdout' did not prevent the search for '('.  At the point
+	 * where build_name calls expr_zalloc_tnode, the parser was already
+	 * in the main file again, thus treating 'stdio_stdout' as not coming
+	 * from a system header.
 	 */
-	/* expect+5: error: controlling expression must be bool, not 'int' [333] */
 	if (ferror(
 # 878 "d_c99_bool_strict.c" 3 4
 	stdio_stdout /* comment */

Index: src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.exp
diff -u src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.exp:1.30 src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.exp:1.31
--- src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.exp:1.30	Tue Nov 16 06:55:03 2021
+++ src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.exp	Tue Nov 16 18:27:04 2021
@@ -171,5 +171,3 @@ d_c99_bool_strict.c(805): error: control
 d_c99_bool_strict.c(808): error: controlling expression must be bool, not 'int' [333]
 d_c99_bool_strict.c(811): error: operand of '!' must be bool, not 'int' [330]
 d_c99_bool_strict.c(814): error: operand of '!' must be bool, not 'int' [330]
-d_c99_bool_strict.c(853): error: controlling expression must be bool, not 'int' [333]
-d_c99_bool_strict.c(880): error: controlling expression must be bool, not 'int' [333]

Index: src/usr.bin/xlint/lint1/cgram.y
diff -u src/usr.bin/xlint/lint1/cgram.y:1.368 src/usr.bin/xlint/lint1/cgram.y:1.369
--- src/usr.bin/xlint/lint1/cgram.y:1.368	Tue Nov 16 17:41:23 2021
+++ src/usr.bin/xlint/lint1/cgram.y	Tue Nov 16 18:27:04 2021
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.368 2021/11/16 17:41:23 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.369 2021/11/16 18:27:04 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -35,7 +35,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: cgram.y,v 1.368 2021/11/16 17:41:23 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.369 2021/11/16 18:27:04 rillig Exp $");
 #endif
 
 #include 
@@ -420,10 +420,14 @@ string2:
 /* K 7.1, C90 ???, C99 6.5.1, C11 6.5.1 */
 primary_expression:
 	  T_NAME {
-		/* XXX really necessary? */
+	  	bool sys_name, sys_next;
+		sys_name = in_system_header;
 		if (yychar < 0)
 			yychar = yylex();
+		sys_next = in_system_header;
+		

CVS commit: src

2021-11-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Nov 16 18:27:04 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: d_c99_bool_strict.c
d_c99_bool_strict.exp
src/usr.bin/xlint/lint1: cgram.y

Log Message:
lint: fix wrong error message in strict bool mode

This fix only affects the last token before a macro, as well as the last
token in the expanded macro.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c
cvs rdiff -u -r1.30 -r1.31 \
src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.exp
cvs rdiff -u -r1.368 -r1.369 src/usr.bin/xlint/lint1/cgram.y

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



CVS commit: src

2021-11-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Nov 16 17:41:23 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: expr_precedence.c
src/usr.bin/xlint/lint1: cgram.y externs1.h func.c lex.c

Log Message:
lint: rename attron to in_gcc_attribute

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/usr.bin/xlint/lint1/expr_precedence.c
cvs rdiff -u -r1.367 -r1.368 src/usr.bin/xlint/lint1/cgram.y
cvs rdiff -u -r1.138 -r1.139 src/usr.bin/xlint/lint1/externs1.h
cvs rdiff -u -r1.124 -r1.125 src/usr.bin/xlint/lint1/func.c
cvs rdiff -u -r1.85 -r1.86 src/usr.bin/xlint/lint1/lex.c

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

Modified files:

Index: src/tests/usr.bin/xlint/lint1/expr_precedence.c
diff -u src/tests/usr.bin/xlint/lint1/expr_precedence.c:1.7 src/tests/usr.bin/xlint/lint1/expr_precedence.c:1.8
--- src/tests/usr.bin/xlint/lint1/expr_precedence.c:1.7	Mon Jul 26 18:10:14 2021
+++ src/tests/usr.bin/xlint/lint1/expr_precedence.c	Tue Nov 16 17:41:23 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: expr_precedence.c,v 1.7 2021/07/26 18:10:14 rillig Exp $	*/
+/*	$NetBSD: expr_precedence.c,v 1.8 2021/11/16 17:41:23 rillig Exp $	*/
 # 3 "expr_precedence.c"
 
 /*
@@ -28,7 +28,7 @@ void __attribute__((format(printf,
  * __attribute__ are constant expressions, looking up global variables
  * would not make sense.  Therefore, 'var' is undefined.
  *
- * See lex.c, function 'search', keyword 'attron'.
+ * See lex.c, function 'search', keyword 'in_gcc_attribute'.
  */
 /* expect+2: error: 'var' undefined [99] */
 /* expect+1: syntax error '=' [249] */

Index: src/usr.bin/xlint/lint1/cgram.y
diff -u src/usr.bin/xlint/lint1/cgram.y:1.367 src/usr.bin/xlint/lint1/cgram.y:1.368
--- src/usr.bin/xlint/lint1/cgram.y:1.367	Sun Sep 26 01:28:43 2021
+++ src/usr.bin/xlint/lint1/cgram.y	Tue Nov 16 17:41:23 2021
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.367 2021/09/26 01:28:43 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.368 2021/11/16 17:41:23 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -35,7 +35,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: cgram.y,v 1.367 2021/09/26 01:28:43 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.368 2021/11/16 17:41:23 rillig Exp $");
 #endif
 
 #include 
@@ -2032,9 +2032,9 @@ gcc_attribute_list:
 
 gcc_attribute:
 	  T_ATTRIBUTE T_LPAREN T_LPAREN {
-	attron = true;
+	in_gcc_attribute = true;
 	  } gcc_attribute_spec_list {
-	attron = false;
+	in_gcc_attribute = false;
 	  } T_RPAREN T_RPAREN
 	;
 

Index: src/usr.bin/xlint/lint1/externs1.h
diff -u src/usr.bin/xlint/lint1/externs1.h:1.138 src/usr.bin/xlint/lint1/externs1.h:1.139
--- src/usr.bin/xlint/lint1/externs1.h:1.138	Tue Aug 31 17:51:30 2021
+++ src/usr.bin/xlint/lint1/externs1.h	Tue Nov 16 17:41:23 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: externs1.h,v 1.138 2021/08/31 17:51:30 rillig Exp $	*/
+/*	$NetBSD: externs1.h,v 1.139 2021/11/16 17:41:23 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -70,7 +70,7 @@ extern	int	yyparse(void);
 /*
  * scan.l
  */
-extern  bool	attron;
+extern  bool	in_gcc_attribute;
 extern	pos_t	curr_pos;
 extern	pos_t	csrc_pos;
 extern	bool	in_system_header;

Index: src/usr.bin/xlint/lint1/func.c
diff -u src/usr.bin/xlint/lint1/func.c:1.124 src/usr.bin/xlint/lint1/func.c:1.125
--- src/usr.bin/xlint/lint1/func.c:1.124	Sat Sep  4 12:37:46 2021
+++ src/usr.bin/xlint/lint1/func.c	Tue Nov 16 17:41:23 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: func.c,v 1.124 2021/09/04 12:37:46 rillig Exp $	*/
+/*	$NetBSD: func.c,v 1.125 2021/11/16 17:41:23 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: func.c,v 1.124 2021/09/04 12:37:46 rillig Exp $");
+__RCSID("$NetBSD: func.c,v 1.125 2021/11/16 17:41:23 rillig Exp $");
 #endif
 
 #include 
@@ -1157,9 +1157,9 @@ global_clean_up_decl(bool silent)
 
 	/*
 	 * Needed for BSD yacc in case of parse errors; GNU Bison 3.0.4 is
-	 * fine.  See gcc_attribute.c, function_with_unknown_attribute.
+	 * fine.  See test gcc_attribute.c, function_with_unknown_attribute.
 	 */
-	attron = false;
+	in_gcc_attribute = false;
 }
 
 /*

Index: src/usr.bin/xlint/lint1/lex.c
diff -u src/usr.bin/xlint/lint1/lex.c:1.85 src/usr.bin/xlint/lint1/lex.c:1.86
--- src/usr.bin/xlint/lint1/lex.c:1.85	Mon Nov  1 19:10:07 2021
+++ src/usr.bin/xlint/lint1/lex.c	Tue Nov 16 17:41:23 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: lex.c,v 1.85 2021/11/01 19:10:07 rillig Exp $ */
+/* $NetBSD: lex.c,v 1.86 2021/11/16 17:41:23 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: lex.c,v 1.85 2021/11/01 19:10:07 rillig Exp $");
+__RCSID("$NetBSD: lex.c,v 1.86 

CVS commit: src

2021-11-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Nov 16 17:41:23 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: expr_precedence.c
src/usr.bin/xlint/lint1: cgram.y externs1.h func.c lex.c

Log Message:
lint: rename attron to in_gcc_attribute

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/usr.bin/xlint/lint1/expr_precedence.c
cvs rdiff -u -r1.367 -r1.368 src/usr.bin/xlint/lint1/cgram.y
cvs rdiff -u -r1.138 -r1.139 src/usr.bin/xlint/lint1/externs1.h
cvs rdiff -u -r1.124 -r1.125 src/usr.bin/xlint/lint1/func.c
cvs rdiff -u -r1.85 -r1.86 src/usr.bin/xlint/lint1/lex.c

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



CVS commit: src/bin

2021-11-16 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Nov 16 16:57:15 UTC 2021

Modified Files:
src/bin/pwd: pwd.c
src/bin/sh: cd.c

Log Message:
Make pwd (both /bin/pwd and the /bin/sh built-in version) check for
write errors on stdout, and indicate an error if that happens.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/bin/pwd/pwd.c
cvs rdiff -u -r1.51 -r1.52 src/bin/sh/cd.c

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



CVS commit: src/bin

2021-11-16 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Nov 16 16:57:15 UTC 2021

Modified Files:
src/bin/pwd: pwd.c
src/bin/sh: cd.c

Log Message:
Make pwd (both /bin/pwd and the /bin/sh built-in version) check for
write errors on stdout, and indicate an error if that happens.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/bin/pwd/pwd.c
cvs rdiff -u -r1.51 -r1.52 src/bin/sh/cd.c

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

Modified files:

Index: src/bin/pwd/pwd.c
diff -u src/bin/pwd/pwd.c:1.22 src/bin/pwd/pwd.c:1.23
--- src/bin/pwd/pwd.c:1.22	Mon Aug 29 14:51:19 2011
+++ src/bin/pwd/pwd.c	Tue Nov 16 16:57:15 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: pwd.c,v 1.22 2011/08/29 14:51:19 joerg Exp $ */
+/* $NetBSD: pwd.c,v 1.23 2021/11/16 16:57:15 kre Exp $ */
 
 /*
  * Copyright (c) 1991, 1993, 1994
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1991, 19
 #if 0
 static char sccsid[] = "@(#)pwd.c	8.3 (Berkeley) 4/1/94";
 #else
-__RCSID("$NetBSD: pwd.c,v 1.22 2011/08/29 14:51:19 joerg Exp $");
+__RCSID("$NetBSD: pwd.c,v 1.23 2021/11/16 16:57:15 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -107,6 +107,10 @@ main(int argc, char *argv[])
 
 	(void)printf("%s\n", p);
 
+	(void)fflush(stdout);
+	if (ferror(stdout))
+		err(EXIT_FAILURE, "stdout");
+
 	exit(EXIT_SUCCESS);
 	/* NOTREACHED */
 }

Index: src/bin/sh/cd.c
diff -u src/bin/sh/cd.c:1.51 src/bin/sh/cd.c:1.52
--- src/bin/sh/cd.c:1.51	Sun Oct 31 02:12:01 2021
+++ src/bin/sh/cd.c	Tue Nov 16 16:57:15 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: cd.c,v 1.51 2021/10/31 02:12:01 kre Exp $	*/
+/*	$NetBSD: cd.c,v 1.52 2021/11/16 16:57:15 kre Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)cd.c	8.2 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: cd.c,v 1.51 2021/10/31 02:12:01 kre Exp $");
+__RCSID("$NetBSD: cd.c,v 1.52 2021/11/16 16:57:15 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -364,8 +364,15 @@ pwdcmd(int argc, char **argv)
 		if (curdir == NULL)
 			error("Unable to find current directory");
 	}
+
+	flushout(out1);		/* make sure buffer is empty */
+	clr_err(out1);		/* and forget any earlier errors */
 	out1str(curdir);
 	out1c('\n');
+	flushout(out1);
+	if (io_err(out1))
+		error("stdout: %s", strerror(errno));
+
 	return 0;
 }
 



CVS commit: src/bin/sh

2021-11-16 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Nov 16 11:28:29 UTC 2021

Modified Files:
src/bin/sh: exec.c sh.1

Log Message:
PR bin/56491

Make "hash" exit(!=0) (ie: exit(1)) if it writes an error message to
stderr as required by POSIX (it was writing "not found" errors, yet
still doing exit(0)).

Whether, when doing "hash foobar", and "foobar" is not found as a command
(not a built-in, not a function, and not found via a PATH search), that
should be considered an error differs between shells.  All of the ksh
descendant shells say "no", write no error message in this case, and
exit(0) if no other errors occur.   Other shells (essentially all) do
consider it an error, write a message to stderr, and exit(1) when this happens.

POSIX isn't clear, the bug report:
 https://austingroupbugs.net/view.php?id=1460
which is not yet resolved, suggests that the outcome will be that
this is to be unspecified.   Given the diversity, there might be no
other choice.

Have a foot in both camps - default to the "other shell" behaviour,
but add a -e option (no errors ... applies only to these "not found"
errors) to generate the ksh behaviour.   Without other errors (like an
unknown option, etc) "hash -e anyname" will always exit(0).

See the PR for details on how it all works now, or read the updated man page.

While here, when hash is in its other mode (reporting what is in the
table) check for I/O errors on stdout, and exit(1) (with an error
message!) if any occurred.   This does not apply to output generated
by the -v option when command names are given (that output is incidental).

In sh.1 document all of this.   Also add documentation for a bunch of
other options the hash command has had for years, but which were never
documented.   And while there, clean up some other sections I noticed
needed improving (either formatting or content or both).


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/bin/sh/exec.c
cvs rdiff -u -r1.236 -r1.237 src/bin/sh/sh.1

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

Modified files:

Index: src/bin/sh/exec.c
diff -u src/bin/sh/exec.c:1.56 src/bin/sh/exec.c:1.57
--- src/bin/sh/exec.c:1.56	Sun Oct 10 08:19:02 2021
+++ src/bin/sh/exec.c	Tue Nov 16 11:28:29 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: exec.c,v 1.56 2021/10/10 08:19:02 rillig Exp $	*/
+/*	$NetBSD: exec.c,v 1.57 2021/11/16 11:28:29 kre Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)exec.c	8.4 (Berkeley) 6/8/95";
 #else
-__RCSID("$NetBSD: exec.c,v 1.56 2021/10/10 08:19:02 rillig Exp $");
+__RCSID("$NetBSD: exec.c,v 1.57 2021/11/16 11:28:29 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -360,18 +360,25 @@ hashcmd(int argc, char **argv)
 	struct cmdentry entry;
 	char *name;
 	int allopt=0, bopt=0, fopt=0, ropt=0, sopt=0, uopt=0, verbose=0;
+	int errs=1, emsg=DO_ERR;
+	int status = 0;
 
-	while ((c = nextopt("bcfrsuv")) != '\0')
+	while ((c = nextopt("bcefqrsuv")) != '\0')
 		switch (c) {
 		case 'b':	bopt = 1;	break;
 		case 'c':	uopt = 1;	break;	/* c == u */
+		case 'e':	errs = 0;	break;
 		case 'f':	fopt = 1;	break;
+		case 'q':	emsg = 0;	break;
 		case 'r':	ropt = 1;	break;
 		case 's':	sopt = 1;	break;
 		case 'u':	uopt = 1;	break;
 		case 'v':	verbose = 1;	break;
 		}
 
+	if (!errs)
+		emsg ^= DO_ERR;
+
 	if (ropt)
 		clearcmdentry(0);
 
@@ -406,6 +413,11 @@ hashcmd(int argc, char **argv)
 	printentry(cmdp, verbose);
 			}
 		}
+		flushout(out1);
+		if (io_err(out1)) {
+			out2str("hash: I/O error writing to standard output\n");
+			return 1;
+		}
 		return 0;
 	}
 
@@ -433,7 +445,9 @@ hashcmd(int argc, char **argv)
 break;
 			}
 		}
-		find_command(name, , DO_ERR, pathval());
+		find_command(name, , emsg, pathval());
+		if (errs && entry.cmdtype == CMDUNKNOWN)
+			status = 1;
 		if (verbose) {
 			if (entry.cmdtype != CMDUNKNOWN) {	/* if no error msg */
 cmdp = cmdlookup(name, 0);
@@ -443,7 +457,7 @@ hashcmd(int argc, char **argv)
 			flushall();
 		}
 	}
-	return 0;
+	return status;
 }
 
 STATIC void

Index: src/bin/sh/sh.1
diff -u src/bin/sh/sh.1:1.236 src/bin/sh/sh.1:1.237
--- src/bin/sh/sh.1:1.236	Sun Oct 31 02:12:08 2021
+++ src/bin/sh/sh.1	Tue Nov 16 11:28:29 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sh.1,v 1.236 2021/10/31 02:12:08 kre Exp $
+.\"	$NetBSD: sh.1,v 1.237 2021/11/16 11:28:29 kre Exp $
 .\" Copyright (c) 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
 .\"
@@ -2356,7 +2356,7 @@ last, in the character class.
 .\"
 .Ss Built-ins
 .\"
-This section lists the built-in commands which are built-in because they
+This section lists the built-in commands which are built in because they
 need to perform some operation that can't be performed by a separate
 process.
 Or just because they traditionally are.
@@ -2366,11 +2366,16 @@ be built in for efficiency (e.g.
 .Xr echo 1 ,
 .Xr test 1 ,
 etc).
+Most built-in commands will 

CVS commit: src/bin/sh

2021-11-16 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Nov 16 11:28:29 UTC 2021

Modified Files:
src/bin/sh: exec.c sh.1

Log Message:
PR bin/56491

Make "hash" exit(!=0) (ie: exit(1)) if it writes an error message to
stderr as required by POSIX (it was writing "not found" errors, yet
still doing exit(0)).

Whether, when doing "hash foobar", and "foobar" is not found as a command
(not a built-in, not a function, and not found via a PATH search), that
should be considered an error differs between shells.  All of the ksh
descendant shells say "no", write no error message in this case, and
exit(0) if no other errors occur.   Other shells (essentially all) do
consider it an error, write a message to stderr, and exit(1) when this happens.

POSIX isn't clear, the bug report:
 https://austingroupbugs.net/view.php?id=1460
which is not yet resolved, suggests that the outcome will be that
this is to be unspecified.   Given the diversity, there might be no
other choice.

Have a foot in both camps - default to the "other shell" behaviour,
but add a -e option (no errors ... applies only to these "not found"
errors) to generate the ksh behaviour.   Without other errors (like an
unknown option, etc) "hash -e anyname" will always exit(0).

See the PR for details on how it all works now, or read the updated man page.

While here, when hash is in its other mode (reporting what is in the
table) check for I/O errors on stdout, and exit(1) (with an error
message!) if any occurred.   This does not apply to output generated
by the -v option when command names are given (that output is incidental).

In sh.1 document all of this.   Also add documentation for a bunch of
other options the hash command has had for years, but which were never
documented.   And while there, clean up some other sections I noticed
needed improving (either formatting or content or both).


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/bin/sh/exec.c
cvs rdiff -u -r1.236 -r1.237 src/bin/sh/sh.1

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



CVS commit: src/bin/sh

2021-11-16 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Nov 16 11:27:50 UTC 2021

Modified Files:
src/bin/sh: eval.c miscbltin.c redir.c

Log Message:
Detect write errors to stdout, and exit(1) from some built-in
commands which (primarily) are used just to generate output
(or with a particular option combination do so).


To generate a diff of this commit:
cvs rdiff -u -r1.184 -r1.185 src/bin/sh/eval.c
cvs rdiff -u -r1.45 -r1.46 src/bin/sh/miscbltin.c
cvs rdiff -u -r1.70 -r1.71 src/bin/sh/redir.c

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

Modified files:

Index: src/bin/sh/eval.c
diff -u src/bin/sh/eval.c:1.184 src/bin/sh/eval.c:1.185
--- src/bin/sh/eval.c:1.184	Tue Nov 16 11:25:44 2021
+++ src/bin/sh/eval.c	Tue Nov 16 11:27:50 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: eval.c,v 1.184 2021/11/16 11:25:44 kre Exp $	*/
+/*	$NetBSD: eval.c,v 1.185 2021/11/16 11:27:50 kre Exp $	*/
 
 /*-
  * Copyright (c) 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)eval.c	8.9 (Berkeley) 6/8/95";
 #else
-__RCSID("$NetBSD: eval.c,v 1.184 2021/11/16 11:25:44 kre Exp $");
+__RCSID("$NetBSD: eval.c,v 1.185 2021/11/16 11:27:50 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -1346,6 +1346,7 @@ evalcommand(union node *cmd, int flgs, s
 			optreset = 1;
 			optind = 1;
 			builtin_flags = flags;
+			clr_err(out1);	/* discard previous I/O errors */
 			exitstatus = cmdentry.u.bltin(argc, argv);
 		} else {
 			e = exception;

Index: src/bin/sh/miscbltin.c
diff -u src/bin/sh/miscbltin.c:1.45 src/bin/sh/miscbltin.c:1.46
--- src/bin/sh/miscbltin.c:1.45	Wed Sep 15 18:30:57 2021
+++ src/bin/sh/miscbltin.c	Tue Nov 16 11:27:50 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: miscbltin.c,v 1.45 2021/09/15 18:30:57 kre Exp $	*/
+/*	$NetBSD: miscbltin.c,v 1.46 2021/11/16 11:27:50 kre Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)miscbltin.c	8.4 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: miscbltin.c,v 1.45 2021/09/15 18:30:57 kre Exp $");
+__RCSID("$NetBSD: miscbltin.c,v 1.46 2021/11/16 11:27:50 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -288,6 +288,11 @@ umaskcmd(int argc, char **argv)
 			umask(~mask & 0777);
 		}
 	}
+	flushout(out1);
+	if (io_err(out1)) {
+		out2str("umask: I/O error\n");
+		return 1;
+	}
 	return 0;
 }
 
@@ -445,7 +450,7 @@ ulimitcmd(int argc, char **argv)
 out1fmt("%c", which ? '\t' : '\n');
 			}
 		}
-		return 0;
+		goto done;
 	}
 
 	if (getrlimit(l->cmd, ) == -1)
@@ -477,5 +482,11 @@ ulimitcmd(int argc, char **argv)
 #endif
 		}
 	}
+  done:;
+	flushout(out1);
+	if (io_err(out1)) {
+		out2str("ulimit: I/O error (stdout)\n");
+		return 1;
+	}
 	return 0;
 }

Index: src/bin/sh/redir.c
diff -u src/bin/sh/redir.c:1.70 src/bin/sh/redir.c:1.71
--- src/bin/sh/redir.c:1.70	Wed Nov 10 15:26:34 2021
+++ src/bin/sh/redir.c	Tue Nov 16 11:27:50 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: redir.c,v 1.70 2021/11/10 15:26:34 kre Exp $	*/
+/*	$NetBSD: redir.c,v 1.71 2021/11/16 11:27:50 kre Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)redir.c	8.2 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: redir.c,v 1.70 2021/11/10 15:26:34 kre Exp $");
+__RCSID("$NetBSD: redir.c,v 1.71 2021/11/16 11:27:50 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -1033,10 +1033,8 @@ fdflagscmd(int argc, char *argv[])
 
 		for (i = 0; i <= max_user_fd; i++)
 			printone(i, 0, verbose, 1);
-		return 0;
-	}
 
-	while ((num = *argv++) != NULL) {
+	} else while ((num = *argv++) != NULL) {
 		int fd = number(num);
 
 		while (num[0] == '0' && num[1] != '\0')		/* skip 0's */
@@ -1050,6 +1048,11 @@ fdflagscmd(int argc, char *argv[])
 		else
 			printone(fd, 1, verbose, argc > 1);
 	}
+	flushout(out1);
+	if (io_err(out1)) {
+		out2str("fdflags: I/O error\n");
+		return 1;
+	}
 	return 0;
 }
 



CVS commit: src/bin/sh

2021-11-16 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Nov 16 11:27:50 UTC 2021

Modified Files:
src/bin/sh: eval.c miscbltin.c redir.c

Log Message:
Detect write errors to stdout, and exit(1) from some built-in
commands which (primarily) are used just to generate output
(or with a particular option combination do so).


To generate a diff of this commit:
cvs rdiff -u -r1.184 -r1.185 src/bin/sh/eval.c
cvs rdiff -u -r1.45 -r1.46 src/bin/sh/miscbltin.c
cvs rdiff -u -r1.70 -r1.71 src/bin/sh/redir.c

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



CVS commit: src/bin/sh

2021-11-16 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Nov 16 11:25:44 UTC 2021

Modified Files:
src/bin/sh: eval.c nodetypes parser.c

Log Message:
Fix value of ${LINENO} in "for" commands.

This affects (as best I can tell) only uses of ${LINENO} in PS4
when -x is enabled (and perhaps only when the list contains no
expansions).   "for" like "case" (which was already handled) is
special in that it generates trace output before actually executing
any kind of simple command.


To generate a diff of this commit:
cvs rdiff -u -r1.183 -r1.184 src/bin/sh/eval.c
cvs rdiff -u -r1.18 -r1.19 src/bin/sh/nodetypes
cvs rdiff -u -r1.174 -r1.175 src/bin/sh/parser.c

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

Modified files:

Index: src/bin/sh/eval.c
diff -u src/bin/sh/eval.c:1.183 src/bin/sh/eval.c:1.184
--- src/bin/sh/eval.c:1.183	Wed Nov 10 15:26:34 2021
+++ src/bin/sh/eval.c	Tue Nov 16 11:25:44 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: eval.c,v 1.183 2021/11/10 15:26:34 kre Exp $	*/
+/*	$NetBSD: eval.c,v 1.184 2021/11/16 11:25:44 kre Exp $	*/
 
 /*-
  * Copyright (c) 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)eval.c	8.9 (Berkeley) 6/8/95";
 #else
-__RCSID("$NetBSD: eval.c,v 1.183 2021/11/10 15:26:34 kre Exp $");
+__RCSID("$NetBSD: eval.c,v 1.184 2021/11/16 11:25:44 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -469,6 +469,7 @@ evalfor(union node *n, int flags)
 
 	loopnest++;
 	for (sp = arglist.list ; sp ; sp = sp->next) {
+		line_number = n->nfor.lineno;
 		if (xflag) {
 			outxstr(expandstr(ps4val(), line_number));
 			outxstr("for ");

Index: src/bin/sh/nodetypes
diff -u src/bin/sh/nodetypes:1.18 src/bin/sh/nodetypes:1.19
--- src/bin/sh/nodetypes:1.18	Thu Jun  8 13:12:17 2017
+++ src/bin/sh/nodetypes	Tue Nov 16 11:25:44 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: nodetypes,v 1.18 2017/06/08 13:12:17 kre Exp $
+#	$NetBSD: nodetypes,v 1.19 2021/11/16 11:25:44 kre Exp $
 # Copyright (c) 1991, 1993
 #	The Regents of the University of California.  All rights reserved.
 #
@@ -90,6 +90,7 @@ NFOR nfor			# the for statement
 	args	  nodeptr		# for var in args
 	body	  nodeptr		# do body; done
 	var	  string		# the for variable
+	lineno	  int
 
 NCASE ncase			# a case statement
 	type	  int

Index: src/bin/sh/parser.c
diff -u src/bin/sh/parser.c:1.174 src/bin/sh/parser.c:1.175
--- src/bin/sh/parser.c:1.174	Wed Sep 15 18:29:45 2021
+++ src/bin/sh/parser.c	Tue Nov 16 11:25:44 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: parser.c,v 1.174 2021/09/15 18:29:45 kre Exp $	*/
+/*	$NetBSD: parser.c,v 1.175 2021/11/16 11:25:44 kre Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)parser.c	8.7 (Berkeley) 5/16/95";
 #else
-__RCSID("$NetBSD: parser.c,v 1.174 2021/09/15 18:29:45 kre Exp $");
+__RCSID("$NetBSD: parser.c,v 1.175 2021/11/16 11:25:44 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -411,6 +411,7 @@ command(void)
 		n1 = stalloc(sizeof(struct nfor));
 		n1->type = NFOR;
 		n1->nfor.var = wordtext;
+		n1->nfor.lineno = startlinno;
 		linebreak();
 		if (lasttoken==TWORD && !quoteflag && equal(wordtext,"in")) {
 			app = 



CVS commit: src/bin/sh

2021-11-16 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Nov 16 11:25:44 UTC 2021

Modified Files:
src/bin/sh: eval.c nodetypes parser.c

Log Message:
Fix value of ${LINENO} in "for" commands.

This affects (as best I can tell) only uses of ${LINENO} in PS4
when -x is enabled (and perhaps only when the list contains no
expansions).   "for" like "case" (which was already handled) is
special in that it generates trace output before actually executing
any kind of simple command.


To generate a diff of this commit:
cvs rdiff -u -r1.183 -r1.184 src/bin/sh/eval.c
cvs rdiff -u -r1.18 -r1.19 src/bin/sh/nodetypes
cvs rdiff -u -r1.174 -r1.175 src/bin/sh/parser.c

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



CVS commit: src/tests/bin/sh

2021-11-16 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Nov 16 11:15:26 UTC 2021

Modified Files:
src/tests/bin/sh: t_redir.sh

Log Message:
Fix a test that has been (unnoticed) failing ever since printf(1) was
changed to exit(1) when it detects a write error to stdout.

Running printf with stdout closed is guaranteed to generate such a
condition.

Until the previous commit, while the test case was actually failing
(stderr was expected to be empty. and was not) this was unnoticed.
We don't want the output (obviously), we also don't want the error
message, so just direct the latter to /dev/null.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/tests/bin/sh/t_redir.sh

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

Modified files:

Index: src/tests/bin/sh/t_redir.sh
diff -u src/tests/bin/sh/t_redir.sh:1.12 src/tests/bin/sh/t_redir.sh:1.13
--- src/tests/bin/sh/t_redir.sh:1.12	Tue Nov 16 11:12:14 2021
+++ src/tests/bin/sh/t_redir.sh	Tue Nov 16 11:15:26 2021
@@ -1,4 +1,4 @@
-# $NetBSD: t_redir.sh,v 1.12 2021/11/16 11:12:14 kre Exp $
+# $NetBSD: t_redir.sh,v 1.13 2021/11/16 11:15:26 kre Exp $
 #
 # Copyright (c) 2016 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -927,7 +927,7 @@ validate_fn_redirects_body()
 
 	echo '
 		. ./f-def || echo >&2 FAIL
-		f >&-
+		f >&- 2>/dev/null
 		printf "%s\n" stdin2
 	' | atf_check -s exit:0 -o inline:'stdin2\n' -e empty ${TEST_SH} ||
 		atf_fail "stdin2 test failure"



CVS commit: src/tests/bin/sh

2021-11-16 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Nov 16 11:15:26 UTC 2021

Modified Files:
src/tests/bin/sh: t_redir.sh

Log Message:
Fix a test that has been (unnoticed) failing ever since printf(1) was
changed to exit(1) when it detects a write error to stdout.

Running printf with stdout closed is guaranteed to generate such a
condition.

Until the previous commit, while the test case was actually failing
(stderr was expected to be empty. and was not) this was unnoticed.
We don't want the output (obviously), we also don't want the error
message, so just direct the latter to /dev/null.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/tests/bin/sh/t_redir.sh

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



CVS commit: src/tests/bin/sh

2021-11-16 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Nov 16 11:12:15 UTC 2021

Modified Files:
src/tests/bin/sh: t_redir.sh t_syntax.sh

Log Message:
Correct a systematic atf_check usage error.   One must not pipe into
atf_check and simply expect it to work - the shell is permitted to,
and our shell currently does, run all commands in a pipeline in subshell
environments - when atf_check attempts to exit to indicate failure, it
only exits from that subshell, and the rest of the test continues, usually
to indicate success

Instead, when it is necessary (or just convenient) to pipe into atf_check
check the exit status of the pipeline (if atf_check is not last, which it
would usually be, then we would need the pipefail option set - there are
currently no such cases), and explicitly fail if atf_check did not exit(0).


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/tests/bin/sh/t_redir.sh
cvs rdiff -u -r1.10 -r1.11 src/tests/bin/sh/t_syntax.sh

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

Modified files:

Index: src/tests/bin/sh/t_redir.sh
diff -u src/tests/bin/sh/t_redir.sh:1.11 src/tests/bin/sh/t_redir.sh:1.12
--- src/tests/bin/sh/t_redir.sh:1.11	Wed May 19 22:43:18 2021
+++ src/tests/bin/sh/t_redir.sh	Tue Nov 16 11:12:14 2021
@@ -1,4 +1,4 @@
-# $NetBSD: t_redir.sh,v 1.11 2021/05/19 22:43:18 kre Exp $
+# $NetBSD: t_redir.sh,v 1.12 2021/11/16 11:12:14 kre Exp $
 #
 # Copyright (c) 2016 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -561,9 +561,11 @@ named_fd_redirections_body()
 		atf_require_prog cat
 
 		echo GOOD | atf_check -s exit:0 -o inline:'GOOD\n' -e empty \
-			${TEST_SH} -c 'read var &2 FAIL
 		f
 		printf '%s\n' stdin1
-	"| atf_check -s exit:0 -o inline:'In-Func\nstdin1\n' -e empty ${TEST_SH}
+	" | atf_check -s exit:0 -o inline:'In-Func\nstdin1\n' -e empty \
+	  ${TEST_SH} ||
+		atf_fail "stdin1 test failure"
 
 	echo '
 		. ./f-def || echo >&2 FAIL
 		f >&-
 		printf "%s\n" stdin2
-	' | atf_check -s exit:0 -o inline:'stdin2\n' -e empty ${TEST_SH}
+	' | atf_check -s exit:0 -o inline:'stdin2\n' -e empty ${TEST_SH} ||
+		atf_fail "stdin2 test failure"
 
 	cat <<- 'DONE' > fgh.def
 		f() {
@@ -983,7 +988,8 @@ validate_fn_redirects_body()
 		echo X $( f >&- & sleep 1; g >&- & sleep 1 ; h ) Y
 		sleep 3
 		exec 4>&1 || echo FD_FAIL
-	' | atf_check -s exit:0 -o inline:'fghX Y\nGF' -e empty ${TEST_SH}
+	' | atf_check -s exit:0 -o inline:'fghX Y\nGF' -e empty ${TEST_SH} ||
+		atf_fail "48875 stdin variant failure"
 }
 
 atf_init_test_cases() {

Index: src/tests/bin/sh/t_syntax.sh
diff -u src/tests/bin/sh/t_syntax.sh:1.10 src/tests/bin/sh/t_syntax.sh:1.11
--- src/tests/bin/sh/t_syntax.sh:1.10	Wed Nov 14 02:37:51 2018
+++ src/tests/bin/sh/t_syntax.sh	Tue Nov 16 11:12:14 2021
@@ -1,4 +1,4 @@
-# $NetBSD: t_syntax.sh,v 1.10 2018/11/14 02:37:51 kre Exp $
+# $NetBSD: t_syntax.sh,v 1.11 2021/11/16 11:12:14 kre Exp $
 #
 # Copyright (c) 2017 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -134,35 +134,39 @@ c_line_wrapping_body() {
 	atf_require_prog ls
 	atf_require_prog printf
 
-	cat <<- 'DONE' | atf_check -s exit:0 -o ignore -e empty ${TEST_SH} -e
+	cat <<- 'DONE' | atf_check -s exit:0 -o ignore -e empty ${TEST_SH} -e ||
 		l\
 		s
 	DONE
+		atf_fail "#1: ls wrapped fails"
 
-	cat <<- 'DONE' | atf_check -s exit:7 -o empty -e empty ${TEST_SH}
+	cat <<- 'DONE' | atf_check -s exit:7 -o empty -e empty ${TEST_SH} ||
 		e\
 		x\
 		it \
 		7
 	DONE
+		atf_fail "#2: exit7 wrapped fails"
 
 	# Have to do this twice as cannot say "any exit code but 0 or 7" ...
 	cat <<- 'DONE' | atf_check -s not-exit:0 -o empty -e not-empty \
-	${TEST_SH}
+	${TEST_SH} ||
 		e\
 		x\
 		it\
 		7
 	DONE
+		atf_fail "#3a: !exit(0||7) badly wrapped fails (0)"
 	cat <<- 'DONE' | atf_check -s not-exit:7 -o empty -e not-empty \
-	${TEST_SH}
+	${TEST_SH} ||
 		e\
 		x\
 		it\
 		7
 	DONE
+		atf_fail "#3b: !exit(0||7) badly wrapped fails (7)"
 
-	cat <<- 'DONE' | atf_check -s exit:0 -o empty -e empty  ${TEST_SH}
+	cat <<- 'DONE' | atf_check -s exit:0 -o empty -e empty  ${TEST_SH} ||
 		wh\
 		il\
 		e \
@@ -173,9 +177,10 @@ c_line_wrapping_body() {
 		;
 		done
 	DONE
+		atf_fail "#4: wrapped while fails"
 
 	cat <<- 'DONE' | atf_check -s exit:0 -o inline:'hellohellohellohello' \
-	-e empty ${TEST_SH}
+	-e empty ${TEST_SH} ||
 		V\
 		AR=hel\
 		lo
@@ -214,8 +219,9 @@ c_line_wrapping_body() {
 		 \
 		FAIL}
 	DONE
+		atf_fail "#5: wrapped var expansions fails"
 
-	cat <<- 'DONE' | atf_check -s exit:0 -o inline:'2\n' ${TEST_SH}
+	cat <<- 'DONE' | atf_check -s exit:0 -o inline:'2\n' ${TEST_SH} ||
 		l\
 		s=7 bi\
 		n\
@@ -225,6 +231,7 @@ c_line_wrapping_body() {
 		( ls /bin )\
 		)
 	DONE
+		atf_fail "#6: wrapped command substitution fails"
 
 	# Inspired by src/etc/MAKEDEV.tmpl failure with (broken)
 	# sh LINENO code...  avoid it happening again...
@@ -248,7 +255,7 @@ c_line_wrapping_body() {
 			done

CVS commit: src/tests/bin/sh

2021-11-16 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Nov 16 11:12:15 UTC 2021

Modified Files:
src/tests/bin/sh: t_redir.sh t_syntax.sh

Log Message:
Correct a systematic atf_check usage error.   One must not pipe into
atf_check and simply expect it to work - the shell is permitted to,
and our shell currently does, run all commands in a pipeline in subshell
environments - when atf_check attempts to exit to indicate failure, it
only exits from that subshell, and the rest of the test continues, usually
to indicate success

Instead, when it is necessary (or just convenient) to pipe into atf_check
check the exit status of the pipeline (if atf_check is not last, which it
would usually be, then we would need the pipefail option set - there are
currently no such cases), and explicitly fail if atf_check did not exit(0).


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/tests/bin/sh/t_redir.sh
cvs rdiff -u -r1.10 -r1.11 src/tests/bin/sh/t_syntax.sh

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



CVS commit: src/external/mit/xorg

2021-11-16 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Tue Nov 16 09:25:52 UTC 2021

Modified Files:
src/external/mit/xorg/bin/xterm: Makefile
src/external/mit/xorg/lib/freetype: Makefile
src/external/mit/xorg/lib/libX11/dynamic: Makefile
src/external/mit/xorg/lib/libX11/static: Makefile
src/external/mit/xorg/lib/libXfont: Makefile
src/external/mit/xorg/lib/libXfont2: Makefile
src/external/mit/xorg/lib/libXpm: Makefile
src/external/mit/xorg/server/xorg-server: Makefile.common
Makefile.serverlib Makefile.servermod
src/external/mit/xorg/server/xorg-server/hw/xfree86/Xorg: Makefile

Log Message:
xorg: sprinkle a little bit of USE_FORT around


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/external/mit/xorg/bin/xterm/Makefile
cvs rdiff -u -r1.22 -r1.23 src/external/mit/xorg/lib/freetype/Makefile
cvs rdiff -u -r1.4 -r1.5 src/external/mit/xorg/lib/libX11/dynamic/Makefile
cvs rdiff -u -r1.4 -r1.5 src/external/mit/xorg/lib/libX11/static/Makefile
cvs rdiff -u -r1.12 -r1.13 src/external/mit/xorg/lib/libXfont/Makefile
cvs rdiff -u -r1.7 -r1.8 src/external/mit/xorg/lib/libXfont2/Makefile
cvs rdiff -u -r1.2 -r1.3 src/external/mit/xorg/lib/libXpm/Makefile
cvs rdiff -u -r1.29 -r1.30 \
src/external/mit/xorg/server/xorg-server/Makefile.common
cvs rdiff -u -r1.14 -r1.15 \
src/external/mit/xorg/server/xorg-server/Makefile.serverlib
cvs rdiff -u -r1.7 -r1.8 \
src/external/mit/xorg/server/xorg-server/Makefile.servermod
cvs rdiff -u -r1.20 -r1.21 \
src/external/mit/xorg/server/xorg-server/hw/xfree86/Xorg/Makefile

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

Modified files:

Index: src/external/mit/xorg/bin/xterm/Makefile
diff -u src/external/mit/xorg/bin/xterm/Makefile:1.22 src/external/mit/xorg/bin/xterm/Makefile:1.23
--- src/external/mit/xorg/bin/xterm/Makefile:1.22	Tue Apr 27 02:11:55 2021
+++ src/external/mit/xorg/bin/xterm/Makefile	Tue Nov 16 09:25:51 2021
@@ -1,4 +1,6 @@
-#	$NetBSD: Makefile,v 1.22 2021/04/27 02:11:55 mrg Exp $
+#	$NetBSD: Makefile,v 1.23 2021/11/16 09:25:51 nia Exp $
+
+USE_FORT?=	yes # data-driven bugs?
 
 .include 
 

Index: src/external/mit/xorg/lib/freetype/Makefile
diff -u src/external/mit/xorg/lib/freetype/Makefile:1.22 src/external/mit/xorg/lib/freetype/Makefile:1.23
--- src/external/mit/xorg/lib/freetype/Makefile:1.22	Sat Jul 20 02:06:12 2019
+++ src/external/mit/xorg/lib/freetype/Makefile	Tue Nov 16 09:25:51 2021
@@ -1,4 +1,6 @@
-#	$NetBSD: Makefile,v 1.22 2019/07/20 02:06:12 mrg Exp $
+#	$NetBSD: Makefile,v 1.23 2021/11/16 09:25:51 nia Exp $
+
+USE_FORT?=	yes # data-driven bugs?
 
 .include 
 

Index: src/external/mit/xorg/lib/libX11/dynamic/Makefile
diff -u src/external/mit/xorg/lib/libX11/dynamic/Makefile:1.4 src/external/mit/xorg/lib/libX11/dynamic/Makefile:1.5
--- src/external/mit/xorg/lib/libX11/dynamic/Makefile:1.4	Tue Jul 13 05:53:12 2021
+++ src/external/mit/xorg/lib/libX11/dynamic/Makefile	Tue Nov 16 09:25:51 2021
@@ -1,9 +1,11 @@
-#	$NetBSD: Makefile,v 1.4 2021/07/13 05:53:12 mrg Exp $
+#	$NetBSD: Makefile,v 1.5 2021/11/16 09:25:51 nia Exp $
 
 NOLINT=		1
 NOPROFILE=	1
 NOSTATICLIB=	1
 
+USE_FORT?=	yes # data-driven bugs?
+
 .include 
 
 .include "../Makefile.libx11"

Index: src/external/mit/xorg/lib/libX11/static/Makefile
diff -u src/external/mit/xorg/lib/libX11/static/Makefile:1.4 src/external/mit/xorg/lib/libX11/static/Makefile:1.5
--- src/external/mit/xorg/lib/libX11/static/Makefile:1.4	Tue Jul 13 05:53:13 2021
+++ src/external/mit/xorg/lib/libX11/static/Makefile	Tue Nov 16 09:25:51 2021
@@ -1,7 +1,9 @@
-#	$NetBSD: Makefile,v 1.4 2021/07/13 05:53:13 mrg Exp $
+#	$NetBSD: Makefile,v 1.5 2021/11/16 09:25:51 nia Exp $
 
 NOPIC=	1
 
+USE_FORT?=	yes # data-driven bugs?
+
 .include 
 
 .include "../Makefile.libx11"

Index: src/external/mit/xorg/lib/libXfont/Makefile
diff -u src/external/mit/xorg/lib/libXfont/Makefile:1.12 src/external/mit/xorg/lib/libXfont/Makefile:1.13
--- src/external/mit/xorg/lib/libXfont/Makefile:1.12	Tue Apr 13 04:59:00 2021
+++ src/external/mit/xorg/lib/libXfont/Makefile	Tue Nov 16 09:25:51 2021
@@ -1,4 +1,6 @@
-#	$NetBSD: Makefile,v 1.12 2021/04/13 04:59:00 mrg Exp $
+#	$NetBSD: Makefile,v 1.13 2021/11/16 09:25:51 nia Exp $
+
+USE_FORT?=	yes # data-driven bugs?
 
 .include 
 

Index: src/external/mit/xorg/lib/libXfont2/Makefile
diff -u src/external/mit/xorg/lib/libXfont2/Makefile:1.7 src/external/mit/xorg/lib/libXfont2/Makefile:1.8
--- src/external/mit/xorg/lib/libXfont2/Makefile:1.7	Tue Apr 13 04:59:00 2021
+++ src/external/mit/xorg/lib/libXfont2/Makefile	Tue Nov 16 09:25:51 2021
@@ -1,4 +1,6 @@
-#	$NetBSD: Makefile,v 1.7 2021/04/13 04:59:00 mrg Exp $
+#	$NetBSD: Makefile,v 1.8 2021/11/16 09:25:51 nia Exp $
+
+USE_FORT?=	yes # data-driven bugs?
 
 .include 
 

Index: src/external/mit/xorg/lib/libXpm/Makefile
diff -u src/external/mit/xorg/lib/libXpm/Makefile:1.2 

CVS commit: src/external/mit/xorg

2021-11-16 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Tue Nov 16 09:25:52 UTC 2021

Modified Files:
src/external/mit/xorg/bin/xterm: Makefile
src/external/mit/xorg/lib/freetype: Makefile
src/external/mit/xorg/lib/libX11/dynamic: Makefile
src/external/mit/xorg/lib/libX11/static: Makefile
src/external/mit/xorg/lib/libXfont: Makefile
src/external/mit/xorg/lib/libXfont2: Makefile
src/external/mit/xorg/lib/libXpm: Makefile
src/external/mit/xorg/server/xorg-server: Makefile.common
Makefile.serverlib Makefile.servermod
src/external/mit/xorg/server/xorg-server/hw/xfree86/Xorg: Makefile

Log Message:
xorg: sprinkle a little bit of USE_FORT around


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/external/mit/xorg/bin/xterm/Makefile
cvs rdiff -u -r1.22 -r1.23 src/external/mit/xorg/lib/freetype/Makefile
cvs rdiff -u -r1.4 -r1.5 src/external/mit/xorg/lib/libX11/dynamic/Makefile
cvs rdiff -u -r1.4 -r1.5 src/external/mit/xorg/lib/libX11/static/Makefile
cvs rdiff -u -r1.12 -r1.13 src/external/mit/xorg/lib/libXfont/Makefile
cvs rdiff -u -r1.7 -r1.8 src/external/mit/xorg/lib/libXfont2/Makefile
cvs rdiff -u -r1.2 -r1.3 src/external/mit/xorg/lib/libXpm/Makefile
cvs rdiff -u -r1.29 -r1.30 \
src/external/mit/xorg/server/xorg-server/Makefile.common
cvs rdiff -u -r1.14 -r1.15 \
src/external/mit/xorg/server/xorg-server/Makefile.serverlib
cvs rdiff -u -r1.7 -r1.8 \
src/external/mit/xorg/server/xorg-server/Makefile.servermod
cvs rdiff -u -r1.20 -r1.21 \
src/external/mit/xorg/server/xorg-server/hw/xfree86/Xorg/Makefile

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