CVS commit: src/bin/ksh

2022-08-21 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Aug 21 20:12:37 UTC 2022

Modified Files:
src/bin/ksh: ksh.Man

Log Message:
ksh(1): fix pasto in the description of the -l option.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/bin/ksh/ksh.Man

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

Modified files:

Index: src/bin/ksh/ksh.Man
diff -u src/bin/ksh/ksh.Man:1.28 src/bin/ksh/ksh.Man:1.29
--- src/bin/ksh/ksh.Man:1.28	Sun Aug  7 11:06:18 2022
+++ src/bin/ksh/ksh.Man	Sun Aug 21 20:12:37 2022
@@ -1,5 +1,5 @@
 '\" t
-.\" $NetBSD: ksh.Man,v 1.28 2022/08/07 11:06:18 andvar Exp $
+.\" $NetBSD: ksh.Man,v 1.29 2022/08/21 20:12:37 uwe Exp $
 .\"{{{}}}
 .\"{{{  Notes about man page
 .\" - use the pseudo-macros .sh( and .sh) to begin and end sh-specific
@@ -66,7 +66,6 @@ the shell executes the command(s) contai
 interactive mode \(em see below
 .IP \fB\-l\fP
 login shell \(em see below
-interactive mode \(em see below
 .IP \fB\-s\fP
 the shell reads commands from standard input; all non-option arguments
 are positional parameters



CVS commit: src/bin/ksh

2022-08-21 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Aug 21 20:12:37 UTC 2022

Modified Files:
src/bin/ksh: ksh.Man

Log Message:
ksh(1): fix pasto in the description of the -l option.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/bin/ksh/ksh.Man

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



CVS commit: src/bin/ksh

2022-07-03 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun Jul  3 06:30:31 UTC 2022

Modified Files:
src/bin/ksh: expr.c

Log Message:
Fix core dump caused by
ksh -c '(i=10; echo $((++-+++i)))'
reported by Steffen Nurpmeso (not on a NetBSD list or PR).

Seems pointless to fix just one of the bugs in this thing, but this one was
easy enough (and stupid enough).   (The "i=10" part is unimportant, as is the 
sub-shell).


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/bin/ksh/expr.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/ksh/expr.c
diff -u src/bin/ksh/expr.c:1.12 src/bin/ksh/expr.c:1.13
--- src/bin/ksh/expr.c:1.12	Tue May  8 16:37:59 2018
+++ src/bin/ksh/expr.c	Sun Jul  3 06:30:31 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: expr.c,v 1.12 2018/05/08 16:37:59 kamil Exp $	*/
+/*	$NetBSD: expr.c,v 1.13 2022/07/03 06:30:31 kre Exp $	*/
 
 /*
  * Korn expression evaluation
@@ -9,7 +9,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: expr.c,v 1.12 2018/05/08 16:37:59 kamil Exp $");
+__RCSID("$NetBSD: expr.c,v 1.13 2022/07/03 06:30:31 kre Exp $");
 #endif
 
 
@@ -311,6 +311,8 @@ evalexpr(es, prec)
 			token(es);
 		} else if (op == O_PLUSPLUS || op == O_MINUSMINUS) {
 			token(es);
+			if (es->tok != VAR)
+evalerr(es, ET_LVALUE, opinfo[(int) op].name);
 			vl = do_ppmm(es, op, es->val, true);
 			token(es);
 		} else if (op == VAR || op == LIT) {



CVS commit: src/bin/ksh

2022-07-03 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun Jul  3 06:30:31 UTC 2022

Modified Files:
src/bin/ksh: expr.c

Log Message:
Fix core dump caused by
ksh -c '(i=10; echo $((++-+++i)))'
reported by Steffen Nurpmeso (not on a NetBSD list or PR).

Seems pointless to fix just one of the bugs in this thing, but this one was
easy enough (and stupid enough).   (The "i=10" part is unimportant, as is the 
sub-shell).


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/bin/ksh/expr.c

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



CVS commit: src/bin/ksh

2021-09-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Sep 16 19:44:01 UTC 2021

Modified Files:
src/bin/ksh: c_test.c shf.c tree.c vi.c

Log Message:
It is either teaching gcc about aaah or adding FALLTHROUGH.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/bin/ksh/c_test.c src/bin/ksh/tree.c
cvs rdiff -u -r1.13 -r1.14 src/bin/ksh/shf.c
cvs rdiff -u -r1.20 -r1.21 src/bin/ksh/vi.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/ksh/c_test.c
diff -u src/bin/ksh/c_test.c:1.9 src/bin/ksh/c_test.c:1.10
--- src/bin/ksh/c_test.c:1.9	Fri Jun 30 00:41:19 2017
+++ src/bin/ksh/c_test.c	Thu Sep 16 15:44:01 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: c_test.c,v 1.9 2017/06/30 04:41:19 kamil Exp $	*/
+/*	$NetBSD: c_test.c,v 1.10 2021/09/16 19:44:01 christos Exp $	*/
 
 /*
  * test(1); version 7-like  --  author Erik Baalbergen
@@ -11,7 +11,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: c_test.c,v 1.9 2017/06/30 04:41:19 kamil Exp $");
+__RCSID("$NetBSD: c_test.c,v 1.10 2021/09/16 19:44:01 christos Exp $");
 #endif
 
 #include 
@@ -393,6 +393,7 @@ test_eval(te, op, opnd1, opnd2, do_eval)
 return v1 < v2;
 			}
 		}
+		abort();
 	  case TO_FILNT: /* -nt */
 		{
 			int s2;
Index: src/bin/ksh/tree.c
diff -u src/bin/ksh/tree.c:1.9 src/bin/ksh/tree.c:1.10
--- src/bin/ksh/tree.c:1.9	Tue May  8 12:37:59 2018
+++ src/bin/ksh/tree.c	Thu Sep 16 15:44:01 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.9 2018/05/08 16:37:59 kamil Exp $	*/
+/*	$NetBSD: tree.c,v 1.10 2021/09/16 19:44:01 christos Exp $	*/
 
 /*
  * command tree climbing
@@ -6,7 +6,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: tree.c,v 1.9 2018/05/08 16:37:59 kamil Exp $");
+__RCSID("$NetBSD: tree.c,v 1.10 2021/09/16 19:44:01 christos Exp $");
 #endif
 
 
@@ -106,8 +106,8 @@ ptree(t, indent, shf)
 #ifdef KSH
 	  case TSELECT:
 		fptreef(shf, indent, "select %s ", t->str);
-		/* fall through */
 #endif /* KSH */
+		/*FALLTHROUGH*/
 	  case TFOR:
 		if (t->type == TFOR)
 			fptreef(shf, indent, "for %s ", t->str);

Index: src/bin/ksh/shf.c
diff -u src/bin/ksh/shf.c:1.13 src/bin/ksh/shf.c:1.14
--- src/bin/ksh/shf.c:1.13	Thu Jun 29 23:56:12 2017
+++ src/bin/ksh/shf.c	Thu Sep 16 15:44:01 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: shf.c,v 1.13 2017/06/30 03:56:12 kamil Exp $	*/
+/*	$NetBSD: shf.c,v 1.14 2021/09/16 19:44:01 christos Exp $	*/
 
 /*
  *  Shell file I/O routines
@@ -6,7 +6,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: shf.c,v 1.13 2017/06/30 03:56:12 kamil Exp $");
+__RCSID("$NetBSD: shf.c,v 1.14 2021/09/16 19:44:01 christos Exp $");
 #endif
 
 #include 
@@ -984,6 +984,7 @@ shf_vfprintf(shf, fmt, args)
 			if (sizeof(char *) > sizeof(int))
 flags |= FL_LONG; /* hope it fits.. */
 			/* aaahhh... */
+			/*FALLTHROUGH*/
 		case 'd':
 		case 'i':
 		case 'o':
@@ -1000,7 +1001,7 @@ shf_vfprintf(shf, fmt, args)
 else
 	tmp = 0;
 /* aaa. */
-
+/*FALLTHROUGH*/
 			case 'u':
 do {
 	*--s = lnum % 10 + '0';

Index: src/bin/ksh/vi.c
diff -u src/bin/ksh/vi.c:1.20 src/bin/ksh/vi.c:1.21
--- src/bin/ksh/vi.c:1.20	Tue May  8 12:37:59 2018
+++ src/bin/ksh/vi.c	Thu Sep 16 15:44:01 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: vi.c,v 1.20 2018/05/08 16:37:59 kamil Exp $	*/
+/*	$NetBSD: vi.c,v 1.21 2021/09/16 19:44:01 christos Exp $	*/
 
 /*
  *	vi command editing
@@ -9,7 +9,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: vi.c,v 1.20 2018/05/08 16:37:59 kamil Exp $");
+__RCSID("$NetBSD: vi.c,v 1.21 2021/09/16 19:44:01 christos Exp $");
 #endif
 
 #include "config.h"
@@ -793,6 +793,7 @@ vi_cmd(argcnt, cmd)
 		case 'Y':
 			cmd = "y$";
 			/* ahh... */
+			/*FALLTHROUGH*/
 		case 'c':
 		case 'd':
 		case 'y':
@@ -1004,6 +1005,7 @@ vi_cmd(argcnt, cmd)
 			if (hnum == hlast)
 hnum = -1;
 			/* ahhh */
+			/*FALLTHROUGH*/
 		case '/':
 			c3 = 1;
 			srchlen = 0;
@@ -1131,6 +1133,7 @@ vi_cmd(argcnt, cmd)
 		case Ctrl('['):			/* some annoying at ksh's */
 			if (!Flag(FVIESCCOMPLETE))
 return -1;
+			/*FALLTHROUGH*/
 		case '\\':			/* at ksh */
 		case Ctrl('f'):			/* Nonstandard vi/ksh */
 			complete_word(1, argcnt);
@@ -1194,7 +1197,7 @@ domove(argcnt, cmd, sub)
 		fsavecmd = *cmd;
 		fsavech = cmd[1];
 		/* drop through */
-
+		/*FALLTHROUGH*/
 	case ',':
 	case ';':
 		if (fsavecmd == ' ')



CVS commit: src/bin/ksh

2021-09-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Sep 16 19:44:01 UTC 2021

Modified Files:
src/bin/ksh: c_test.c shf.c tree.c vi.c

Log Message:
It is either teaching gcc about aaah or adding FALLTHROUGH.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/bin/ksh/c_test.c src/bin/ksh/tree.c
cvs rdiff -u -r1.13 -r1.14 src/bin/ksh/shf.c
cvs rdiff -u -r1.20 -r1.21 src/bin/ksh/vi.c

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



CVS commit: src/bin/ksh

2021-09-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Sep 16 19:43:33 UTC 2021

Modified Files:
src/bin/ksh: c_ksh.c

Log Message:
support -Z


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/bin/ksh/c_ksh.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/ksh/c_ksh.c
diff -u src/bin/ksh/c_ksh.c:1.29 src/bin/ksh/c_ksh.c:1.30
--- src/bin/ksh/c_ksh.c:1.29	Sun Jun  3 08:18:29 2018
+++ src/bin/ksh/c_ksh.c	Thu Sep 16 15:43:33 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: c_ksh.c,v 1.29 2018/06/03 12:18:29 kamil Exp $	*/
+/*	$NetBSD: c_ksh.c,v 1.30 2021/09/16 19:43:33 christos Exp $	*/
 
 /*
  * built-in Korn commands: c_*
@@ -6,7 +6,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: c_ksh.c,v 1.29 2018/06/03 12:18:29 kamil Exp $");
+__RCSID("$NetBSD: c_ksh.c,v 1.30 2021/09/16 19:43:33 christos Exp $");
 #endif
 
 #include 
@@ -1072,9 +1072,10 @@ c_jobs(wp)
 	int optc;
 	int flag = 0;
 	int nflag = 0;
+	int Zflag = 0;
 	int rv = 0;
 
-	while ((optc = ksh_getopt(wp, _opt, "lpnz")) != EOF)
+	while ((optc = ksh_getopt(wp, _opt, "lpnzZ")) != EOF)
 		switch (optc) {
 		  case 'l':
 			flag = 1;
@@ -1088,10 +1089,21 @@ c_jobs(wp)
 		  case 'z':	/* debugging: print zombies */
 			nflag = -1;
 			break;
+		  case 'Z':
+			Zflag = 1;
+			break;
 		  case '?':
 			return 1;
 		}
 	wp += builtin_opt.optind;
+	if (Zflag) {
+		if (*wp && **wp) {
+			setproctitle("%s", *wp);
+		} else {
+			setproctitle(NULL);
+		}
+		return 0;
+	}
 	if (!*wp) {
 		if (j_jobs((char *) 0, flag, nflag))
 			rv = 1;



CVS commit: src/bin/ksh

2021-09-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Sep 16 19:43:33 UTC 2021

Modified Files:
src/bin/ksh: c_ksh.c

Log Message:
support -Z


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/bin/ksh/c_ksh.c

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



CVS commit: src/bin/ksh

2021-02-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Feb 23 01:31:30 UTC 2021

Modified Files:
src/bin/ksh: siglist.sh

Log Message:
PR/56007: Greg A. Woods: ksh unable to execute ERR traps
(probably since 2016/03/17 - i.e. 8.x and 9.x)


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

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

Modified files:

Index: src/bin/ksh/siglist.sh
diff -u src/bin/ksh/siglist.sh:1.12 src/bin/ksh/siglist.sh:1.13
--- src/bin/ksh/siglist.sh:1.12	Thu Mar 17 09:59:02 2016
+++ src/bin/ksh/siglist.sh	Mon Feb 22 20:31:30 2021
@@ -1,5 +1,5 @@
 #!/bin/sh
-#	$NetBSD: siglist.sh,v 1.12 2016/03/17 13:59:02 christos Exp $
+#	$NetBSD: siglist.sh,v 1.13 2021/02/23 01:31:30 christos Exp $
 #
 # Script to generate a sorted, complete list of signals, suitable
 # for inclusion in trap.c as array initializer.
@@ -21,16 +21,17 @@ CPP="${1-cc -E}"
 # The trap here to make up for a bug in bash (1.14.3(1)) that calls the trap
 (trap $trapsigs;
  echo '#include "sh.h"';
- echo '	{ QwErTy SIGNALS , "DUMMY" , "hook for number of signals" },';
+ echo ' { QwErTy /* dummy for sed sillies */ },';
  ${SED} -e '/^[	 ]*#/d' -e 's/^[	 ]*\([^ 	][^ 	]*\)[	 ][	 ]*\(.*[^ 	]\)[ 	]*$/#ifdef SIG\1\
 	{ QwErTy .signal = SIG\1 , .name = "\1", .mess = "\2" },\
 #endif/') > $in
-# work around for gcc 5
+echo '	{ QwErTy .signal = SIGNALS , .name = "DUMMY", .mess = "hook to expand array to total signals" },' >> $in
+# work around for gcc > 5
 $CPP $in | grep -v '^#' | tr -d '\n' | ${SED} 's/},/},\
 /g' > $out
 ${SED} -n 's/{ QwErTy/{/p' < $out | ${AWK} '{print NR, $0}' | sort -k 5n -k 1n |
-${SED} 's/^[0-9]* //' |
-${AWK} 'BEGIN { last=0; nsigs=0; }
+${SED} -E -e 's/^[0-9]* //' -e 's/ +/ /' |
+${AWK} 'BEGIN { last=0; }
 	{
 	if ($4 ~ /^[0-9][0-9]*$/ && $5 == ",") {
 		n = $4;



CVS commit: src/bin/ksh

2021-02-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Feb 23 01:31:30 UTC 2021

Modified Files:
src/bin/ksh: siglist.sh

Log Message:
PR/56007: Greg A. Woods: ksh unable to execute ERR traps
(probably since 2016/03/17 - i.e. 8.x and 9.x)


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

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



CVS commit: src/bin/ksh

2019-10-29 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Oct 29 16:19:59 UTC 2019

Modified Files:
src/bin/ksh: misc.c

Log Message:
Avoid arithmetics on strings.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/bin/ksh/misc.c

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



CVS commit: src/bin/ksh

2019-10-29 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Oct 29 16:19:59 UTC 2019

Modified Files:
src/bin/ksh: misc.c

Log Message:
Avoid arithmetics on strings.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/bin/ksh/misc.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/ksh/misc.c
diff -u src/bin/ksh/misc.c:1.24 src/bin/ksh/misc.c:1.25
--- src/bin/ksh/misc.c:1.24	Tue May  8 16:37:59 2018
+++ src/bin/ksh/misc.c	Tue Oct 29 16:19:59 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: misc.c,v 1.24 2018/05/08 16:37:59 kamil Exp $	*/
+/*	$NetBSD: misc.c,v 1.25 2019/10/29 16:19:59 joerg Exp $	*/
 
 /*
  * Miscellaneous functions
@@ -6,7 +6,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: misc.c,v 1.24 2018/05/08 16:37:59 kamil Exp $");
+__RCSID("$NetBSD: misc.c,v 1.25 2019/10/29 16:19:59 joerg Exp $");
 #endif
 
 
@@ -1091,7 +1091,7 @@ print_value_quoted(s)
 	}
 	for (p = s; *p; p++) {
 		if (*p == '\'') {
-			shprintf("%s", "'\\'" + 1 - inquote);
+			shprintf("%s", &"'\\'"[1 - inquote]);
 			inquote = 0;
 		} else {
 			if (!inquote) {



CVS commit: src/bin/ksh

2019-09-26 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Thu Sep 26 11:01:09 UTC 2019

Modified Files:
src/bin/ksh: eval.c lex.c

Log Message:
Fix FALLTHROUGH comments.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/bin/ksh/eval.c
cvs rdiff -u -r1.23 -r1.24 src/bin/ksh/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/bin/ksh/eval.c
diff -u src/bin/ksh/eval.c:1.25 src/bin/ksh/eval.c:1.26
--- src/bin/ksh/eval.c:1.25	Tue Jun 12 14:13:55 2018
+++ src/bin/ksh/eval.c	Thu Sep 26 11:01:09 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: eval.c,v 1.25 2018/06/12 14:13:55 kamil Exp $	*/
+/*	$NetBSD: eval.c,v 1.26 2019/09/26 11:01:09 mlelstv Exp $	*/
 
 /*
  * Expansion - quoting, separation, substitution, globbing
@@ -6,7 +6,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: eval.c,v 1.25 2018/06/12 14:13:55 kamil Exp $");
+__RCSID("$NetBSD: eval.c,v 1.26 2019/09/26 11:01:09 mlelstv Exp $");
 #endif
 
 #include 
@@ -493,6 +493,7 @@ expand(cp, wp, f)
 		  case XARGSEP:
 			type = XARG;
 			quote = 1;
+			/* FALLTHROUGH */
 		  case XARG:
 			if ((c = *x.str++) == '\0') {
 /* force null words to be created so

Index: src/bin/ksh/lex.c
diff -u src/bin/ksh/lex.c:1.23 src/bin/ksh/lex.c:1.24
--- src/bin/ksh/lex.c:1.23	Tue May  8 16:37:59 2018
+++ src/bin/ksh/lex.c	Thu Sep 26 11:01:09 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: lex.c,v 1.23 2018/05/08 16:37:59 kamil Exp $	*/
+/*	$NetBSD: lex.c,v 1.24 2019/09/26 11:01:09 mlelstv Exp $	*/
 
 /*
  * lexical analysis and source input
@@ -6,7 +6,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: lex.c,v 1.23 2018/05/08 16:37:59 kamil Exp $");
+__RCSID("$NetBSD: lex.c,v 1.24 2019/09/26 11:01:09 mlelstv Exp $");
 #endif
 
 
@@ -254,7 +254,7 @@ yylex(cf)
 		*wp++ = QCHAR, *wp++ = c;
 		break;
 	}
-	/* FALLTROUGH */
+	/* FALLTHROUGH */
   default:
 	Xcheck(ws, wp);
 	if (c) { /* trailing \ is lost */



CVS commit: src/bin/ksh

2019-09-26 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Thu Sep 26 11:01:09 UTC 2019

Modified Files:
src/bin/ksh: eval.c lex.c

Log Message:
Fix FALLTHROUGH comments.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/bin/ksh/eval.c
cvs rdiff -u -r1.23 -r1.24 src/bin/ksh/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/ksh

2018-08-26 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Sun Aug 26 22:52:34 UTC 2018

Modified Files:
src/bin/ksh: ksh.Man

Log Message:
Add -l to SYNOPSIS


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/bin/ksh/ksh.Man

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

Modified files:

Index: src/bin/ksh/ksh.Man
diff -u src/bin/ksh/ksh.Man:1.25 src/bin/ksh/ksh.Man:1.26
--- src/bin/ksh/ksh.Man:1.25	Wed Dec 30 22:26:26 2015
+++ src/bin/ksh/ksh.Man	Sun Aug 26 22:52:34 2018
@@ -1,5 +1,5 @@
 '\" t
-.\" $NetBSD: ksh.Man,v 1.25 2015/12/30 22:26:26 christos Exp $
+.\" $NetBSD: ksh.Man,v 1.26 2018/08/26 22:52:34 sevan Exp $
 .\"{{{}}}
 .\"{{{  Notes about man page
 .\" - use the pseudo-macros .sh( and .sh) to begin and end sh-specific
@@ -19,10 +19,10 @@
 .\"}}}
 .\"{{{  Title
 .ksh(
-.TH KSH 1 "April 12, 2015" "" "User commands"
+.TH KSH 1 "August 26, 2018" "" "User commands"
 .ksh)
 .sh(
-.TH SH 1 "April 12, 2015" "" "User commands"
+.TH SH 1 "August 26, 2018" "" "User commands"
 .sh)
 .\"}}}
 .\"{{{  Name
@@ -43,7 +43,7 @@ sh \- Public domain Bourne shell
 .sh(
 \fBsh\fP
 .sh)
-[\fB\(+-abCefhikmnprsuvxX\fP] [\fB\(+-o\fP \fIoption\fP] [ [ \fB\-c\fP \fIcommand-string\fP [\fIcommand-name\fP] | \fB\-s\fP | \fIfile\fP ] [\fIargument\fP ...] ]
+[\fB\(+-abCefhiklmnprsuvxX\fP] [\fB\(+-o\fP \fIoption\fP] [ [ \fB\-c\fP \fIcommand-string\fP [\fIcommand-name\fP] | \fB\-s\fP | \fIfile\fP ] [\fIargument\fP ...] ]
 .ad b
 .\"}}}
 .\"{{{  Description



CVS commit: src/bin/ksh

2018-08-26 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Sun Aug 26 22:52:34 UTC 2018

Modified Files:
src/bin/ksh: ksh.Man

Log Message:
Add -l to SYNOPSIS


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/bin/ksh/ksh.Man

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



Re: CVS commit: src/bin/ksh

2018-06-12 Thread Valery Ushakov
On Tue, Jun 12, 2018 at 14:13:55 +, Kamil Rytarowski wrote:

> UBSan can detect that during switching a login to root there is unportable
> left shift operation:
> 
> $ su -
> Password:
> /public/src.git/bin/ksh/eval.c:598:13: runtime error: left shift of 
> 1073741824 by 1 places cannot be represented in type 'int'
> #

Is this, seriously, how you reproduce it?  It doesn't trigger on just
running ksh?  In which case what is the real problem here - it must be
triggered by some .profile code, which your "reproducer" doesn't
provide.

-uwe


CVS commit: src/bin/ksh

2018-06-12 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Tue Jun 12 14:13:55 UTC 2018

Modified Files:
src/bin/ksh: eval.c

Log Message:
Change typ of tilde_ok from int to unsigned int in ksh(1)

UBSan can detect that during switching a login to root there is unportable
left shift operation:

$ su -
Password:
/public/src.git/bin/ksh/eval.c:598:13: runtime error: left shift of 1073741824 
by 1 places cannot be represented in type 'int'
#

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/bin/ksh/eval.c

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



CVS commit: src/bin/ksh

2018-06-12 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Tue Jun 12 14:13:55 UTC 2018

Modified Files:
src/bin/ksh: eval.c

Log Message:
Change typ of tilde_ok from int to unsigned int in ksh(1)

UBSan can detect that during switching a login to root there is unportable
left shift operation:

$ su -
Password:
/public/src.git/bin/ksh/eval.c:598:13: runtime error: left shift of 1073741824 
by 1 places cannot be represented in type 'int'
#

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/bin/ksh/eval.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/ksh/eval.c
diff -u src/bin/ksh/eval.c:1.24 src/bin/ksh/eval.c:1.25
--- src/bin/ksh/eval.c:1.24	Sun Jun  3 16:09:31 2018
+++ src/bin/ksh/eval.c	Tue Jun 12 14:13:55 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: eval.c,v 1.24 2018/06/03 16:09:31 kamil Exp $	*/
+/*	$NetBSD: eval.c,v 1.25 2018/06/12 14:13:55 kamil Exp $	*/
 
 /*
  * Expansion - quoting, separation, substitution, globbing
@@ -6,7 +6,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: eval.c,v 1.24 2018/06/03 16:09:31 kamil Exp $");
+__RCSID("$NetBSD: eval.c,v 1.25 2018/06/12 14:13:55 kamil Exp $");
 #endif
 
 #include 
@@ -173,7 +173,8 @@ expand(cp, wp, f)
 	Expand x;		/* expansion variables */
 	SubType st_head, *st;
 	int UNINITIALIZED(newlines); /* For trailing newlines in COMSUB */
-	int saw_eq, tilde_ok;
+	int saw_eq;
+	unsigned int tilde_ok;
 	int make_magic;
 	size_t len;
 



CVS commit: src/bin/ksh

2018-06-03 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sun Jun  3 16:09:31 UTC 2018

Modified Files:
src/bin/ksh: eval.c

Log Message:
ksh: Remove symbol clash with libc

Rename local function glob() to ksh_glob().
This is needed for installing interceptors in sanitizers.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/bin/ksh/eval.c

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



CVS commit: src/bin/ksh

2018-06-03 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sun Jun  3 16:09:31 UTC 2018

Modified Files:
src/bin/ksh: eval.c

Log Message:
ksh: Remove symbol clash with libc

Rename local function glob() to ksh_glob().
This is needed for installing interceptors in sanitizers.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/bin/ksh/eval.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/ksh/eval.c
diff -u src/bin/ksh/eval.c:1.23 src/bin/ksh/eval.c:1.24
--- src/bin/ksh/eval.c:1.23	Tue May  8 16:37:59 2018
+++ src/bin/ksh/eval.c	Sun Jun  3 16:09:31 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: eval.c,v 1.23 2018/05/08 16:37:59 kamil Exp $	*/
+/*	$NetBSD: eval.c,v 1.24 2018/06/03 16:09:31 kamil Exp $	*/
 
 /*
  * Expansion - quoting, separation, substitution, globbing
@@ -6,7 +6,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: eval.c,v 1.23 2018/05/08 16:37:59 kamil Exp $");
+__RCSID("$NetBSD: eval.c,v 1.24 2018/06/03 16:09:31 kamil Exp $");
 #endif
 
 #include 
@@ -50,7 +50,7 @@ typedef struct Expand {
 static	int	varsub ARGS((Expand *xp, char *sp, char *word, int *stypep, int *slenp));
 static	int	comsub ARGS((Expand *xp, char *cp));
 static	char   *trimsub ARGS((char *str, char *pat, int how));
-static	void	glob ARGS((char *cp, XPtrV *wp, int markdirs));
+static	void	ksh_glob ARGS((char *cp, XPtrV *wp, int markdirs));
 static	void	globit ARGS((XString *xs, char **xpp, char *sp, XPtrV *wp,
 			 int check));
 static char	*maybe_expand_tilde ARGS((char *p, XString *dsp, char **dpp,
@@ -578,7 +578,7 @@ expand(cp, wp, f)
 else
 #endif /* BRACE_EXPAND */
 if (fdo & DOGLOB)
-	glob(p, wp, f & DOMARKDIRS);
+	ksh_glob(p, wp, f & DOMARKDIRS);
 else if ((f & DOPAT) || !(fdo & DOMAGIC_))
 	XPput(*wp, p);
 else
@@ -945,13 +945,13 @@ trimsub(str, pat, how)
 }
 
 /*
- * glob
+ * ksh_glob
  * Name derived from V6's /etc/glob, the program that expanded filenames.
  */
 
 /* XXX cp not const 'cause slashes are temporarily replaced with nulls... */
 static void
-glob(cp, wp, markdirs)
+ksh_glob(cp, wp, markdirs)
 	char *cp;
 	XPtrV *wp;
 	int markdirs;
@@ -1340,7 +1340,7 @@ alt_expand(wp, start, exp_start, end, fd
 		 * expansion. }
 		 */
 		if (fdo & DOGLOB)
-			glob(start, wp, fdo & DOMARKDIRS);
+			ksh_glob(start, wp, fdo & DOMARKDIRS);
 		else
 			XPput(*wp, debunk(start, start, end - start));
 		return;



CVS commit: src/bin/ksh

2018-06-03 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sun Jun  3 12:18:29 UTC 2018

Modified Files:
src/bin/ksh: c_ksh.c edit.c exec.c proto.h table.c table.h

Log Message:
ksh: Remove symbol clash with libc

Rename local function twalk() to ksh_twak().
This is needed for installing interceptors in sanitizers.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/bin/ksh/c_ksh.c
cvs rdiff -u -r1.34 -r1.35 src/bin/ksh/edit.c
cvs rdiff -u -r1.27 -r1.28 src/bin/ksh/exec.c
cvs rdiff -u -r1.12 -r1.13 src/bin/ksh/proto.h
cvs rdiff -u -r1.7 -r1.8 src/bin/ksh/table.c
cvs rdiff -u -r1.3 -r1.4 src/bin/ksh/table.h

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

Modified files:

Index: src/bin/ksh/c_ksh.c
diff -u src/bin/ksh/c_ksh.c:1.28 src/bin/ksh/c_ksh.c:1.29
--- src/bin/ksh/c_ksh.c:1.28	Tue May  8 16:37:59 2018
+++ src/bin/ksh/c_ksh.c	Sun Jun  3 12:18:29 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: c_ksh.c,v 1.28 2018/05/08 16:37:59 kamil Exp $	*/
+/*	$NetBSD: c_ksh.c,v 1.29 2018/06/03 12:18:29 kamil Exp $	*/
 
 /*
  * built-in Korn commands: c_*
@@ -6,7 +6,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: c_ksh.c,v 1.28 2018/05/08 16:37:59 kamil Exp $");
+__RCSID("$NetBSD: c_ksh.c,v 1.29 2018/06/03 12:18:29 kamil Exp $");
 #endif
 
 #include 
@@ -1032,7 +1032,7 @@ c_unalias(wp)
 	if (all) {
 		struct tstate ts;
 
-		for (twalk(, t); (ap = tnext()); ) {
+		for (ksh_twalk(, t); (ap = tnext()); ) {
 			if (ap->flag) {
 ap->flag &= ~(ALLOC|ISSET);
 afree((void*)ap->val.s, APERM);

Index: src/bin/ksh/edit.c
diff -u src/bin/ksh/edit.c:1.34 src/bin/ksh/edit.c:1.35
--- src/bin/ksh/edit.c:1.34	Sat Jul  1 23:12:08 2017
+++ src/bin/ksh/edit.c	Sun Jun  3 12:18:29 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: edit.c,v 1.34 2017/07/01 23:12:08 joerg Exp $	*/
+/*	$NetBSD: edit.c,v 1.35 2018/06/03 12:18:29 kamil Exp $	*/
 
 /*
  * Command line editing - common code
@@ -7,7 +7,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: edit.c,v 1.34 2017/07/01 23:12:08 joerg Exp $");
+__RCSID("$NetBSD: edit.c,v 1.35 2018/06/03 12:18:29 kamil Exp $");
 #endif
 
 #include 
@@ -938,7 +938,7 @@ glob_table(pat, wp, tp)
 	struct tstate ts;
 	struct tbl *te;
 
-	for (twalk(, tp); (te = tnext()); ) {
+	for (ksh_twalk(, tp); (te = tnext()); ) {
 		if (gmatch(te->name, pat, false))
 			XPput(*wp, str_save(te->name, ATEMP));
 	}

Index: src/bin/ksh/exec.c
diff -u src/bin/ksh/exec.c:1.27 src/bin/ksh/exec.c:1.28
--- src/bin/ksh/exec.c:1.27	Tue May  8 16:37:59 2018
+++ src/bin/ksh/exec.c	Sun Jun  3 12:18:29 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: exec.c,v 1.27 2018/05/08 16:37:59 kamil Exp $	*/
+/*	$NetBSD: exec.c,v 1.28 2018/06/03 12:18:29 kamil Exp $	*/
 
 /*
  * execute command tree
@@ -6,7 +6,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: exec.c,v 1.27 2018/05/08 16:37:59 kamil Exp $");
+__RCSID("$NetBSD: exec.c,v 1.28 2018/06/03 12:18:29 kamil Exp $");
 #endif
 
 #include 
@@ -999,7 +999,7 @@ flushcom(all)
 	struct tbl *tp;
 	struct tstate ts;
 
-	for (twalk(, ); (tp = tnext()) != NULL; )
+	for (ksh_twalk(, ); (tp = tnext()) != NULL; )
 		if ((tp->flag) && (all || !ISDIRSEP(tp->val.s[0]))) {
 			if (tp->flag) {
 tp->flag &= ~(ALLOC|ISSET);

Index: src/bin/ksh/proto.h
diff -u src/bin/ksh/proto.h:1.12 src/bin/ksh/proto.h:1.13
--- src/bin/ksh/proto.h:1.12	Wed Jan 24 09:53:21 2018
+++ src/bin/ksh/proto.h	Sun Jun  3 12:18:29 2018
@@ -1,9 +1,9 @@
-/*	$NetBSD: proto.h,v 1.12 2018/01/24 09:53:21 kamil Exp $	*/
+/*	$NetBSD: proto.h,v 1.13 2018/06/03 12:18:29 kamil Exp $	*/
 
 /*
  * prototypes for PD-KSH
  * originally generated using "cproto.c 3.5 92/04/11 19:28:01 cthuang "
- * $Id: proto.h,v 1.12 2018/01/24 09:53:21 kamil Exp $
+ * $Id: proto.h,v 1.13 2018/06/03 12:18:29 kamil Exp $
  */
 
 #include 
@@ -219,7 +219,7 @@ void 	tinit		ARGS((struct table *, Area 
 struct tbl *	mytsearch	ARGS((struct table *, const char *, unsigned int));
 struct tbl *	tenter	ARGS((struct table *, const char *, unsigned int));
 void 	mytdelete		ARGS((struct tbl *));
-void 	twalk		ARGS((struct tstate *, struct table *));
+void 	ksh_twalk		ARGS((struct tstate *, struct table *));
 struct tbl *	tnext	ARGS((struct tstate *));
 struct tbl **	tsort	ARGS((struct table *));
 /* trace.c */

Index: src/bin/ksh/table.c
diff -u src/bin/ksh/table.c:1.7 src/bin/ksh/table.c:1.8
--- src/bin/ksh/table.c:1.7	Tue May  8 16:37:59 2018
+++ src/bin/ksh/table.c	Sun Jun  3 12:18:29 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: table.c,v 1.7 2018/05/08 16:37:59 kamil Exp $	*/
+/*	$NetBSD: table.c,v 1.8 2018/06/03 12:18:29 kamil Exp $	*/
 
 /*
  * dynamic hashed associative table for commands and variables
@@ -6,7 +6,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: table.c,v 1.7 2018/05/08 16:37:59 kamil Exp $");
+__RCSID("$NetBSD: table.c,v 1.8 2018/06/03 12:18:29 kamil Exp $");
 #endif
 
 
@@ -151,7 +151,7 @@ mytdelete(p)
 }
 
 void
-twalk(ts, tp)
+ksh_twalk(ts, tp)
 	struct tstate *ts;
 	struct table *tp;
 {
@@ 

CVS commit: src/bin/ksh

2018-06-03 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sun Jun  3 12:18:29 UTC 2018

Modified Files:
src/bin/ksh: c_ksh.c edit.c exec.c proto.h table.c table.h

Log Message:
ksh: Remove symbol clash with libc

Rename local function twalk() to ksh_twak().
This is needed for installing interceptors in sanitizers.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/bin/ksh/c_ksh.c
cvs rdiff -u -r1.34 -r1.35 src/bin/ksh/edit.c
cvs rdiff -u -r1.27 -r1.28 src/bin/ksh/exec.c
cvs rdiff -u -r1.12 -r1.13 src/bin/ksh/proto.h
cvs rdiff -u -r1.7 -r1.8 src/bin/ksh/table.c
cvs rdiff -u -r1.3 -r1.4 src/bin/ksh/table.h

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



CVS commit: src/bin/ksh

2018-05-08 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Tue May  8 16:37:59 UTC 2018

Modified Files:
src/bin/ksh: c_ksh.c c_sh.c emacs.c eval.c exec.c expand.h expr.c
history.c io.c lex.c mail.c main.c misc.c syn.c table.c trap.c
tree.c var.c vi.c

Log Message:
Stop using the register keyword in ksh(1)

ksh also does some strange things with it, like put it in argument lists.

No functional change intended.

PR bin/53237 ksh: remove register keyword by Nia Alarie


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/bin/ksh/c_ksh.c
cvs rdiff -u -r1.23 -r1.24 src/bin/ksh/c_sh.c src/bin/ksh/misc.c \
src/bin/ksh/var.c
cvs rdiff -u -r1.37 -r1.38 src/bin/ksh/emacs.c
cvs rdiff -u -r1.22 -r1.23 src/bin/ksh/eval.c src/bin/ksh/lex.c \
src/bin/ksh/main.c
cvs rdiff -u -r1.26 -r1.27 src/bin/ksh/exec.c
cvs rdiff -u -r1.6 -r1.7 src/bin/ksh/expand.h src/bin/ksh/table.c
cvs rdiff -u -r1.11 -r1.12 src/bin/ksh/expr.c
cvs rdiff -u -r1.18 -r1.19 src/bin/ksh/history.c
cvs rdiff -u -r1.17 -r1.18 src/bin/ksh/io.c
cvs rdiff -u -r1.8 -r1.9 src/bin/ksh/mail.c src/bin/ksh/tree.c
cvs rdiff -u -r1.10 -r1.11 src/bin/ksh/syn.c
cvs rdiff -u -r1.13 -r1.14 src/bin/ksh/trap.c
cvs rdiff -u -r1.19 -r1.20 src/bin/ksh/vi.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/ksh/c_ksh.c
diff -u src/bin/ksh/c_ksh.c:1.27 src/bin/ksh/c_ksh.c:1.28
--- src/bin/ksh/c_ksh.c:1.27	Wed Jan 24 09:53:20 2018
+++ src/bin/ksh/c_ksh.c	Tue May  8 16:37:59 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: c_ksh.c,v 1.27 2018/01/24 09:53:20 kamil Exp $	*/
+/*	$NetBSD: c_ksh.c,v 1.28 2018/05/08 16:37:59 kamil Exp $	*/
 
 /*
  * built-in Korn commands: c_*
@@ -6,7 +6,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: c_ksh.c,v 1.27 2018/01/24 09:53:20 kamil Exp $");
+__RCSID("$NetBSD: c_ksh.c,v 1.28 2018/05/08 16:37:59 kamil Exp $");
 #endif
 
 #include 
@@ -317,7 +317,7 @@ c_print(wp)
 	Xinit(xs, xp, 128, ATEMP);
 
 	while (*wp != NULL) {
-		register int c;
+		int c;
 		s = *wp;
 		while ((c = *s++) != '\0') {
 			Xcheck(xs, xp);
@@ -995,8 +995,8 @@ int
 c_unalias(wp)
 	char **wp;
 {
-	register struct table *t = 
-	register struct tbl *ap;
+	struct table *t = 
+	struct tbl *ap;
 	int rv = 0, all = 0;
 	int optc;
 
@@ -1389,7 +1389,7 @@ c_bind(wp)
 	char **wp;
 {
 	int rv = 0, macro = 0, list = 0;
-	register char *cp;
+	char *cp;
 	int optc;
 
 	while ((optc = ksh_getopt(wp, _opt, "lm")) != EOF)

Index: src/bin/ksh/c_sh.c
diff -u src/bin/ksh/c_sh.c:1.23 src/bin/ksh/c_sh.c:1.24
--- src/bin/ksh/c_sh.c:1.23	Fri Jun 30 04:41:19 2017
+++ src/bin/ksh/c_sh.c	Tue May  8 16:37:59 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: c_sh.c,v 1.23 2017/06/30 04:41:19 kamil Exp $	*/
+/*	$NetBSD: c_sh.c,v 1.24 2018/05/08 16:37:59 kamil Exp $	*/
 
 /*
  * built-in Bourne commands
@@ -6,7 +6,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: c_sh.c,v 1.23 2017/06/30 04:41:19 kamil Exp $");
+__RCSID("$NetBSD: c_sh.c,v 1.24 2018/05/08 16:37:59 kamil Exp $");
 #endif
 
 #include 
@@ -31,8 +31,8 @@ int
 c_shift(wp)
 	char **wp;
 {
-	register struct block *l = e->loc;
-	register int n;
+	struct block *l = e->loc;
+	int n;
 	long val;
 	char *arg;
 
@@ -63,8 +63,8 @@ int
 c_umask(wp)
 	char **wp;
 {
-	register int i;
-	register char *cp;
+	int i;
+	char *cp;
 	int symbolic = 0;
 	int old_umask;
 	int optc;
@@ -245,11 +245,11 @@ int
 c_read(wp)
 	char **wp;
 {
-	register int c = 0;
+	int c = 0;
 	int expandv = 1, history = 0;
 	int expanding;
 	int ecode = 0;
-	register char *cp;
+	char *cp;
 	int fd = 0;
 	struct shf *shf;
 	int optc;
@@ -429,7 +429,7 @@ int
 c_eval(wp)
 	char **wp;
 {
-	register struct source *s;
+	struct source *s;
 	int rv;
 
 	if (ksh_getopt(wp, _opt, null) == '?')
@@ -475,7 +475,7 @@ c_trap(wp)
 {
 	int i;
 	char *s;
-	register Trap *p;
+	Trap *p;
 
 	if (ksh_getopt(wp, _opt, null) == '?')
 		return 1;
@@ -635,7 +635,7 @@ c_set(wp)
 {
 	int argi, setargs;
 	struct block *l = e->loc;
-	register char **owp = wp;
+	char **owp = wp;
 
 	if (wp[1] == NULL) {
 		static const char *const args [] = { "set", "-", NULL };
@@ -669,7 +669,7 @@ int
 c_unset(wp)
 	char **wp;
 {
-	register char *id;
+	char *id;
 	int optc, unset_var = 1;
 	int ret = 0;
 
@@ -816,8 +816,8 @@ clocktos(t)
 	clock_t t;
 {
 	static char temp[22]; /* enough for 64 bit clock_t */
-	register int i;
-	register char *cp = temp + sizeof(temp);
+	int i;
+	char *cp = temp + sizeof(temp);
 
 	/* note: posix says must use max precision, ie, if clk_tck is
 	 * 1000, must print 3 places after decimal (if non-zero, else 1).
Index: src/bin/ksh/misc.c
diff -u src/bin/ksh/misc.c:1.23 src/bin/ksh/misc.c:1.24
--- src/bin/ksh/misc.c:1.23	Fri Jun 30 04:41:19 2017
+++ src/bin/ksh/misc.c	Tue May  8 16:37:59 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: misc.c,v 1.23 2017/06/30 04:41:19 kamil Exp $	*/
+/*	$NetBSD: misc.c,v 1.24 2018/05/08 16:37:59 kamil Exp $	*/
 
 /*
  * Miscellaneous functions
@@ -6,7 +6,7 @@
 #include 

CVS commit: src/bin/ksh

2018-05-08 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Tue May  8 16:37:59 UTC 2018

Modified Files:
src/bin/ksh: c_ksh.c c_sh.c emacs.c eval.c exec.c expand.h expr.c
history.c io.c lex.c mail.c main.c misc.c syn.c table.c trap.c
tree.c var.c vi.c

Log Message:
Stop using the register keyword in ksh(1)

ksh also does some strange things with it, like put it in argument lists.

No functional change intended.

PR bin/53237 ksh: remove register keyword by Nia Alarie


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/bin/ksh/c_ksh.c
cvs rdiff -u -r1.23 -r1.24 src/bin/ksh/c_sh.c src/bin/ksh/misc.c \
src/bin/ksh/var.c
cvs rdiff -u -r1.37 -r1.38 src/bin/ksh/emacs.c
cvs rdiff -u -r1.22 -r1.23 src/bin/ksh/eval.c src/bin/ksh/lex.c \
src/bin/ksh/main.c
cvs rdiff -u -r1.26 -r1.27 src/bin/ksh/exec.c
cvs rdiff -u -r1.6 -r1.7 src/bin/ksh/expand.h src/bin/ksh/table.c
cvs rdiff -u -r1.11 -r1.12 src/bin/ksh/expr.c
cvs rdiff -u -r1.18 -r1.19 src/bin/ksh/history.c
cvs rdiff -u -r1.17 -r1.18 src/bin/ksh/io.c
cvs rdiff -u -r1.8 -r1.9 src/bin/ksh/mail.c src/bin/ksh/tree.c
cvs rdiff -u -r1.10 -r1.11 src/bin/ksh/syn.c
cvs rdiff -u -r1.13 -r1.14 src/bin/ksh/trap.c
cvs rdiff -u -r1.19 -r1.20 src/bin/ksh/vi.c

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



CVS commit: src/bin/ksh

2018-01-24 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Jan 24 09:53:21 UTC 2018

Modified Files:
src/bin/ksh: c_ksh.c exec.c lex.c proto.h table.c var.c vi.c

Log Message:
ksh: Rename a local function tsearch to mytsearch

This removes a clash with well-known libc function tsearch(3) from POSIX.

This allows to build ksh against MSan.

The new name might not be perfect, but long term ksh should be switched to
the libc version.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/bin/ksh/c_ksh.c
cvs rdiff -u -r1.25 -r1.26 src/bin/ksh/exec.c
cvs rdiff -u -r1.21 -r1.22 src/bin/ksh/lex.c
cvs rdiff -u -r1.11 -r1.12 src/bin/ksh/proto.h
cvs rdiff -u -r1.5 -r1.6 src/bin/ksh/table.c
cvs rdiff -u -r1.22 -r1.23 src/bin/ksh/var.c
cvs rdiff -u -r1.18 -r1.19 src/bin/ksh/vi.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/ksh/c_ksh.c
diff -u src/bin/ksh/c_ksh.c:1.26 src/bin/ksh/c_ksh.c:1.27
--- src/bin/ksh/c_ksh.c:1.26	Fri Jun 30 04:41:19 2017
+++ src/bin/ksh/c_ksh.c	Wed Jan 24 09:53:20 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: c_ksh.c,v 1.26 2017/06/30 04:41:19 kamil Exp $	*/
+/*	$NetBSD: c_ksh.c,v 1.27 2018/01/24 09:53:20 kamil Exp $	*/
 
 /*
  * built-in Korn commands: c_*
@@ -6,7 +6,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: c_ksh.c,v 1.26 2017/06/30 04:41:19 kamil Exp $");
+__RCSID("$NetBSD: c_ksh.c,v 1.27 2018/01/24 09:53:20 kamil Exp $");
 #endif
 
 #include 
@@ -470,9 +470,9 @@ c_whence(wp)
 	while ((vflag || ret == 0) && (id = *wp++) != NULL) {
 		tp = NULL;
 		if ((iam_whence || vflag) && !pflag)
-			tp = tsearch(, id, hash(id));
+			tp = mytsearch(, id, hash(id));
 		if (!tp && !pflag) {
-			tp = tsearch(, id, hash(id));
+			tp = mytsearch(, id, hash(id));
 			if (tp && !(tp->flag & ISSET))
 tp = NULL;
 		}
@@ -946,7 +946,7 @@ c_alias(wp)
 			alias = str_nsave(alias, val++ - alias, ATEMP);
 		h = hash(alias);
 		if (val == NULL && !tflag && !xflag) {
-			ap = tsearch(t, alias, h);
+			ap = mytsearch(t, alias, h);
 			if (ap != NULL && (ap->flag)) {
 if (pflag)
 	shf_puts("alias ", shl_stdout);
@@ -1017,7 +1017,7 @@ c_unalias(wp)
 	wp += builtin_opt.optind;
 
 	for (; *wp != NULL; wp++) {
-		ap = tsearch(t, *wp, hash(*wp));
+		ap = mytsearch(t, *wp, hash(*wp));
 		if (ap == NULL) {
 			rv = 1;	/* POSIX */
 			continue;

Index: src/bin/ksh/exec.c
diff -u src/bin/ksh/exec.c:1.25 src/bin/ksh/exec.c:1.26
--- src/bin/ksh/exec.c:1.25	Wed Jan 24 09:21:20 2018
+++ src/bin/ksh/exec.c	Wed Jan 24 09:53:21 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: exec.c,v 1.25 2018/01/24 09:21:20 kamil Exp $	*/
+/*	$NetBSD: exec.c,v 1.26 2018/01/24 09:53:21 kamil Exp $	*/
 
 /*
  * execute command tree
@@ -6,7 +6,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: exec.c,v 1.25 2018/01/24 09:21:20 kamil Exp $");
+__RCSID("$NetBSD: exec.c,v 1.26 2018/01/24 09:53:21 kamil Exp $");
 #endif
 
 #include 
@@ -775,7 +775,7 @@ shcomexec(wp)
 {
 	register struct tbl *tp;
 
-	tp = tsearch(, *wp, hash(*wp));
+	tp = mytsearch(, *wp, hash(*wp));
 	if (tp == NULL)
 		internal_errorf(1, "shcomexec: %s", *wp);
 	return call_builtin(tp, wp);
@@ -795,7 +795,7 @@ findfunc(name, h, create)
 	struct tbl *tp = (struct tbl *) 0;
 
 	for (l = e->loc; l; l = l->next) {
-		tp = tsearch(>funs, name, h);
+		tp = mytsearch(>funs, name, h);
 		if (tp)
 			break;
 		if (!l->next && create) {
@@ -906,7 +906,7 @@ findcom(name, flags)
 		flags &= ~FC_FUNC;
 		goto Search;
 	}
-	tbi = (flags & FC_BI) ? tsearch(, name, h) : NULL;
+	tbi = (flags & FC_BI) ? mytsearch(, name, h) : NULL;
 	/* POSIX says special builtins first, then functions, then
 	 * POSIX regular builtins, then search path...
 	 */
@@ -936,7 +936,7 @@ findcom(name, flags)
 	if (!tp && (flags & FC_UNREGBI) && tbi)
 		tp = tbi;
 	if (!tp && (flags & FC_PATH) && !(flags & FC_DEFPATH)) {
-		tp = tsearch(, name, h);
+		tp = mytsearch(, name, h);
 		if (tp && (tp->flag & ISSET) && eaccess(tp->val.s, X_OK) != 0) {
 			if (tp->flag & ALLOC) {
 tp->flag &= ~ALLOC;

Index: src/bin/ksh/lex.c
diff -u src/bin/ksh/lex.c:1.21 src/bin/ksh/lex.c:1.22
--- src/bin/ksh/lex.c:1.21	Fri Jun 30 04:41:19 2017
+++ src/bin/ksh/lex.c	Wed Jan 24 09:53:21 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: lex.c,v 1.21 2017/06/30 04:41:19 kamil Exp $	*/
+/*	$NetBSD: lex.c,v 1.22 2018/01/24 09:53:21 kamil Exp $	*/
 
 /*
  * lexical analysis and source input
@@ -6,7 +6,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: lex.c,v 1.21 2017/06/30 04:41:19 kamil Exp $");
+__RCSID("$NetBSD: lex.c,v 1.22 2018/01/24 09:53:21 kamil Exp $");
 #endif
 
 
@@ -734,13 +734,13 @@ Done:
 		int h = hash(ident);
 
 		/* { */
-		if ((cf & KEYWORD) && (p = tsearch(, ident, h))
+		if ((cf & KEYWORD) && (p = mytsearch(, ident, h))
 		&& (!(cf & ESACONLY) || p->val.i == ESAC || p->val.i == '}'))
 		{
 			afree(yylval.cp, ATEMP);
 			return p->val.i;
 		}
-		if ((cf & ALIAS) && (p = tsearch(, ident, h))
+		if ((cf & ALIAS) && (p 

CVS commit: src/bin/ksh

2018-01-24 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Jan 24 09:53:21 UTC 2018

Modified Files:
src/bin/ksh: c_ksh.c exec.c lex.c proto.h table.c var.c vi.c

Log Message:
ksh: Rename a local function tsearch to mytsearch

This removes a clash with well-known libc function tsearch(3) from POSIX.

This allows to build ksh against MSan.

The new name might not be perfect, but long term ksh should be switched to
the libc version.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/bin/ksh/c_ksh.c
cvs rdiff -u -r1.25 -r1.26 src/bin/ksh/exec.c
cvs rdiff -u -r1.21 -r1.22 src/bin/ksh/lex.c
cvs rdiff -u -r1.11 -r1.12 src/bin/ksh/proto.h
cvs rdiff -u -r1.5 -r1.6 src/bin/ksh/table.c
cvs rdiff -u -r1.22 -r1.23 src/bin/ksh/var.c
cvs rdiff -u -r1.18 -r1.19 src/bin/ksh/vi.c

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



CVS commit: src/bin/ksh

2018-01-24 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Jan 24 09:21:20 UTC 2018

Modified Files:
src/bin/ksh: exec.c proto.h table.c var.c

Log Message:
ksh: Rename a local function tdelete to mytdelete

This removes a clash with well-known libc function tdelete(3) from POSIX.

This allows to build ksh against MSan.

The new name might not be perfect, but long term ksh should be switched to
the libc version.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/bin/ksh/exec.c
cvs rdiff -u -r1.10 -r1.11 src/bin/ksh/proto.h
cvs rdiff -u -r1.4 -r1.5 src/bin/ksh/table.c
cvs rdiff -u -r1.21 -r1.22 src/bin/ksh/var.c

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



CVS commit: src/bin/ksh

2018-01-24 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Jan 24 09:21:20 UTC 2018

Modified Files:
src/bin/ksh: exec.c proto.h table.c var.c

Log Message:
ksh: Rename a local function tdelete to mytdelete

This removes a clash with well-known libc function tdelete(3) from POSIX.

This allows to build ksh against MSan.

The new name might not be perfect, but long term ksh should be switched to
the libc version.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/bin/ksh/exec.c
cvs rdiff -u -r1.10 -r1.11 src/bin/ksh/proto.h
cvs rdiff -u -r1.4 -r1.5 src/bin/ksh/table.c
cvs rdiff -u -r1.21 -r1.22 src/bin/ksh/var.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/ksh/exec.c
diff -u src/bin/ksh/exec.c:1.24 src/bin/ksh/exec.c:1.25
--- src/bin/ksh/exec.c:1.24	Sat Jul  1 23:12:08 2017
+++ src/bin/ksh/exec.c	Wed Jan 24 09:21:20 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: exec.c,v 1.24 2017/07/01 23:12:08 joerg Exp $	*/
+/*	$NetBSD: exec.c,v 1.25 2018/01/24 09:21:20 kamil Exp $	*/
 
 /*
  * execute command tree
@@ -6,7 +6,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: exec.c,v 1.24 2017/07/01 23:12:08 joerg Exp $");
+__RCSID("$NetBSD: exec.c,v 1.25 2018/01/24 09:21:20 kamil Exp $");
 #endif
 
 #include 
@@ -843,7 +843,7 @@ define(name, t)
 	}
 
 	if (t == NULL) {		/* undefine */
-		tdelete(tp);
+		mytdelete(tp);
 		return was_set ? 0 : 1;
 	}
 

Index: src/bin/ksh/proto.h
diff -u src/bin/ksh/proto.h:1.10 src/bin/ksh/proto.h:1.11
--- src/bin/ksh/proto.h:1.10	Sat Jul  1 23:12:08 2017
+++ src/bin/ksh/proto.h	Wed Jan 24 09:21:20 2018
@@ -1,9 +1,9 @@
-/*	$NetBSD: proto.h,v 1.10 2017/07/01 23:12:08 joerg Exp $	*/
+/*	$NetBSD: proto.h,v 1.11 2018/01/24 09:21:20 kamil Exp $	*/
 
 /*
  * prototypes for PD-KSH
  * originally generated using "cproto.c 3.5 92/04/11 19:28:01 cthuang "
- * $Id: proto.h,v 1.10 2017/07/01 23:12:08 joerg Exp $
+ * $Id: proto.h,v 1.11 2018/01/24 09:21:20 kamil Exp $
  */
 
 #include 
@@ -218,7 +218,7 @@ unsigned int 	hash	ARGS((const char *));
 void 	tinit		ARGS((struct table *, Area *, int));
 struct tbl *	tsearch	ARGS((struct table *, const char *, unsigned int));
 struct tbl *	tenter	ARGS((struct table *, const char *, unsigned int));
-void 	tdelete		ARGS((struct tbl *));
+void 	mytdelete		ARGS((struct tbl *));
 void 	twalk		ARGS((struct tstate *, struct table *));
 struct tbl *	tnext	ARGS((struct tstate *));
 struct tbl **	tsort	ARGS((struct table *));

Index: src/bin/ksh/table.c
diff -u src/bin/ksh/table.c:1.4 src/bin/ksh/table.c:1.5
--- src/bin/ksh/table.c:1.4	Mon Jun 23 11:39:04 2003
+++ src/bin/ksh/table.c	Wed Jan 24 09:21:20 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: table.c,v 1.4 2003/06/23 11:39:04 agc Exp $	*/
+/*	$NetBSD: table.c,v 1.5 2018/01/24 09:21:20 kamil Exp $	*/
 
 /*
  * dynamic hashed associative table for commands and variables
@@ -6,7 +6,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: table.c,v 1.4 2003/06/23 11:39:04 agc Exp $");
+__RCSID("$NetBSD: table.c,v 1.5 2018/01/24 09:21:20 kamil Exp $");
 #endif
 
 
@@ -144,7 +144,7 @@ tenter(tp, n, h)
 }
 
 void
-tdelete(p)
+mytdelete(p)
 	register struct tbl *p;
 {
 	p->flag = 0;

Index: src/bin/ksh/var.c
diff -u src/bin/ksh/var.c:1.21 src/bin/ksh/var.c:1.22
--- src/bin/ksh/var.c:1.21	Sat Jul  1 23:12:08 2017
+++ src/bin/ksh/var.c	Wed Jan 24 09:21:20 2018
@@ -1,9 +1,9 @@
-/*	$NetBSD: var.c,v 1.21 2017/07/01 23:12:08 joerg Exp $	*/
+/*	$NetBSD: var.c,v 1.22 2018/01/24 09:21:20 kamil Exp $	*/
 
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: var.c,v 1.21 2017/07/01 23:12:08 joerg Exp $");
+__RCSID("$NetBSD: var.c,v 1.22 2018/01/24 09:21:20 kamil Exp $");
 #endif
 
 #include 
@@ -939,7 +939,7 @@ unspecial(name)
 
 	tp = tsearch(, name, hash(name));
 	if (tp)
-		tdelete(tp);
+		mytdelete(tp);
 }
 
 #ifdef KSH



CVS commit: src/bin/ksh

2018-01-16 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Wed Jan 17 00:29:22 UTC 2018

Modified Files:
src/bin/ksh: history.c

Log Message:
Use 0600 as the mode for histfile here too.

pointed out by John D. Baker in PR bin/52480


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/bin/ksh/history.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/ksh/history.c
diff -u src/bin/ksh/history.c:1.17 src/bin/ksh/history.c:1.18
--- src/bin/ksh/history.c:1.17	Fri Jun 30 04:41:19 2017
+++ src/bin/ksh/history.c	Wed Jan 17 00:29:22 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: history.c,v 1.17 2017/06/30 04:41:19 kamil Exp $	*/
+/*	$NetBSD: history.c,v 1.18 2018/01/17 00:29:22 maya Exp $	*/
 
 /*
  * command history
@@ -19,7 +19,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: history.c,v 1.17 2017/06/30 04:41:19 kamil Exp $");
+__RCSID("$NetBSD: history.c,v 1.18 2018/01/17 00:29:22 maya Exp $");
 #endif
 
 #include 
@@ -753,7 +753,7 @@ hist_finish()
   else
 hp = histlist;
 
-  if ((fd = open(hname, O_WRONLY | O_CREAT | O_TRUNC | O_EXLOCK, 0777)) != -1) {
+  if ((fd = open(hname, O_WRONLY | O_CREAT | O_TRUNC | O_EXLOCK, 0600)) != -1) {
 /* Remove anything written before we got the lock */
 ftruncate(fd, 0);
 if ((fh = fdopen(fd, "w")) != NULL) {



CVS commit: src/bin/ksh

2018-01-16 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Wed Jan 17 00:29:22 UTC 2018

Modified Files:
src/bin/ksh: history.c

Log Message:
Use 0600 as the mode for histfile here too.

pointed out by John D. Baker in PR bin/52480


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/bin/ksh/history.c

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



CVS commit: src/bin/ksh

2017-07-01 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Sat Jul  1 23:12:09 UTC 2017

Modified Files:
src/bin/ksh: edit.c edit.h exec.c expr.c proto.h var.c

Log Message:
Kill enough K cruft to build with clang again.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/bin/ksh/edit.c
cvs rdiff -u -r1.4 -r1.5 src/bin/ksh/edit.h
cvs rdiff -u -r1.23 -r1.24 src/bin/ksh/exec.c
cvs rdiff -u -r1.10 -r1.11 src/bin/ksh/expr.c
cvs rdiff -u -r1.9 -r1.10 src/bin/ksh/proto.h
cvs rdiff -u -r1.20 -r1.21 src/bin/ksh/var.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/ksh/edit.c
diff -u src/bin/ksh/edit.c:1.33 src/bin/ksh/edit.c:1.34
--- src/bin/ksh/edit.c:1.33	Fri Jun 30 05:18:36 2017
+++ src/bin/ksh/edit.c	Sat Jul  1 23:12:08 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: edit.c,v 1.33 2017/06/30 05:18:36 kamil Exp $	*/
+/*	$NetBSD: edit.c,v 1.34 2017/07/01 23:12:08 joerg Exp $	*/
 
 /*
  * Command line editing - common code
@@ -7,7 +7,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: edit.c,v 1.33 2017/06/30 05:18:36 kamil Exp $");
+__RCSID("$NetBSD: edit.c,v 1.34 2017/07/01 23:12:08 joerg Exp $");
 #endif
 
 #include 
@@ -194,8 +194,7 @@ x_puts(s)
 }
 
 bool
-x_mode(onoff)
-	bool	onoff;
+x_mode(bool onoff)
 {
 	static bool	x_cur_mode;
 	bool		prev;

Index: src/bin/ksh/edit.h
diff -u src/bin/ksh/edit.h:1.4 src/bin/ksh/edit.h:1.5
--- src/bin/ksh/edit.h:1.4	Fri Jun 30 04:41:19 2017
+++ src/bin/ksh/edit.h	Sat Jul  1 23:12:08 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: edit.h,v 1.4 2017/06/30 04:41:19 kamil Exp $	*/
+/*	$NetBSD: edit.h,v 1.5 2017/07/01 23:12:08 joerg Exp $	*/
 
 /* NAME:
  *  edit.h - globals for edit modes
@@ -10,7 +10,7 @@
  *  
  *
  * RCSid:
- *  $NetBSD: edit.h,v 1.4 2017/06/30 04:41:19 kamil Exp $
+ *  $NetBSD: edit.h,v 1.5 2017/07/01 23:12:08 joerg Exp $
  *
  */
 
@@ -50,7 +50,7 @@ int 	x_getc		ARGS((void));
 void 	x_flush		ARGS((void));
 void 	x_putc		ARGS((int c));
 void 	x_puts		ARGS((const char *s));
-bool 	x_mode		ARGS((bool onoff));
+bool 	x_mode(bool onoff);
 int 	promptlen	ARGS((const char *cp, const char **spp));
 int	x_do_comment	ARGS((char *buf, int bsize, int *lenp));
 void	x_print_expansions ARGS((int nwords, char *const *words, int is_command));

Index: src/bin/ksh/exec.c
diff -u src/bin/ksh/exec.c:1.23 src/bin/ksh/exec.c:1.24
--- src/bin/ksh/exec.c:1.23	Fri Jun 30 04:41:19 2017
+++ src/bin/ksh/exec.c	Sat Jul  1 23:12:08 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: exec.c,v 1.23 2017/06/30 04:41:19 kamil Exp $	*/
+/*	$NetBSD: exec.c,v 1.24 2017/07/01 23:12:08 joerg Exp $	*/
 
 /*
  * execute command tree
@@ -6,7 +6,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: exec.c,v 1.23 2017/06/30 04:41:19 kamil Exp $");
+__RCSID("$NetBSD: exec.c,v 1.24 2017/07/01 23:12:08 joerg Exp $");
 #endif
 
 #include 
@@ -30,7 +30,7 @@ static int	call_builtin ARGS((struct tbl
 static int	iosetup ARGS((struct ioword *, struct tbl *));
 static int	herein ARGS((const char *, int));
 #ifdef KSH
-static char 	*do_selectargs ARGS((char **, bool));
+static char 	*do_selectargs(char **, bool);
 #endif /* KSH */
 #ifdef KSH
 static int	dbteste_isa ARGS((Test_env *, Test_meta));
@@ -1322,9 +1322,7 @@ herein(content, sub)
  *	print the args in column form - assuming that we can
  */
 static char *
-do_selectargs(ap, print_menu)
-	register char **ap;
-	bool print_menu;
+do_selectargs(char **ap, bool print_menu)
 {
 	static const char *const read_args[] = {
 	"read", "-r", "REPLY", (char *) 0

Index: src/bin/ksh/expr.c
diff -u src/bin/ksh/expr.c:1.10 src/bin/ksh/expr.c:1.11
--- src/bin/ksh/expr.c:1.10	Fri Jun 30 04:41:19 2017
+++ src/bin/ksh/expr.c	Sat Jul  1 23:12:08 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: expr.c,v 1.10 2017/06/30 04:41:19 kamil Exp $	*/
+/*	$NetBSD: expr.c,v 1.11 2017/07/01 23:12:08 joerg Exp $	*/
 
 /*
  * Korn expression evaluation
@@ -9,7 +9,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: expr.c,v 1.10 2017/06/30 04:41:19 kamil Exp $");
+__RCSID("$NetBSD: expr.c,v 1.11 2017/07/01 23:12:08 joerg Exp $");
 #endif
 
 
@@ -138,8 +138,7 @@ static voidevalerr  ARGS((Expr_s
   const char *str)) GCC_FUNC_ATTR(noreturn);
 static struct tbl *evalexpr ARGS((Expr_state *es, enum prec prec));
 static voidtokenARGS((Expr_state *es));
-static struct tbl *do_ppmm  ARGS((Expr_state *es, enum token op,
-  struct tbl *vasn, bool is_prefix));
+static struct tbl *do_ppmm(Expr_state *, enum token, struct tbl *, bool);
 static void	   assign_check ARGS((Expr_state *es, enum token op,
   struct tbl *vasn));
 static struct tbl *tempvar  ARGS((void));
@@ -537,11 +536,7 @@ token(es)
 
 /* Do a ++ or -- operation */
 static struct tbl *
-do_ppmm(es, op, vasn, is_prefix)
-	Expr_state *es;
-	enum token op;
-	struct tbl *vasn;
-	bool is_prefix;
+do_ppmm(Expr_state *es, enum token op, struct tbl *vasn, bool is_prefix)
 {
 	struct tbl *vl;
 	int oval;

Index: src/bin/ksh/proto.h
diff 

CVS commit: src/bin/ksh

2017-07-01 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Sat Jul  1 23:12:09 UTC 2017

Modified Files:
src/bin/ksh: edit.c edit.h exec.c expr.c proto.h var.c

Log Message:
Kill enough K cruft to build with clang again.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/bin/ksh/edit.c
cvs rdiff -u -r1.4 -r1.5 src/bin/ksh/edit.h
cvs rdiff -u -r1.23 -r1.24 src/bin/ksh/exec.c
cvs rdiff -u -r1.10 -r1.11 src/bin/ksh/expr.c
cvs rdiff -u -r1.9 -r1.10 src/bin/ksh/proto.h
cvs rdiff -u -r1.20 -r1.21 src/bin/ksh/var.c

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



CVS commit: src/bin/ksh

2017-06-29 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 30 05:18:36 UTC 2017

Modified Files:
src/bin/ksh: edit.c

Log Message:
ksh: Eliminate dead function x_complete_word()


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/bin/ksh/edit.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/ksh/edit.c
diff -u src/bin/ksh/edit.c:1.32 src/bin/ksh/edit.c:1.33
--- src/bin/ksh/edit.c:1.32	Fri Jun 30 04:41:19 2017
+++ src/bin/ksh/edit.c	Fri Jun 30 05:18:36 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: edit.c,v 1.32 2017/06/30 04:41:19 kamil Exp $	*/
+/*	$NetBSD: edit.c,v 1.33 2017/06/30 05:18:36 kamil Exp $	*/
 
 /*
  * Command line editing - common code
@@ -7,7 +7,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: edit.c,v 1.32 2017/06/30 04:41:19 kamil Exp $");
+__RCSID("$NetBSD: edit.c,v 1.33 2017/06/30 05:18:36 kamil Exp $");
 #endif
 
 #include 
@@ -451,35 +451,6 @@ static char	*add_glob ARGS((const char *
 static void	glob_table ARGS((const char *, XPtrV *, struct table *));
 static void	glob_path ARGS((int, const char *, XPtrV *, const char *));
 
-#if 0 /* not used... */
-int	x_complete_word ARGS((const char *, int, int, int *, char **));
-int
-x_complete_word(str, slen, is_command, nwordsp, ret)
-	const char *str;
-	int slen;
-	int is_command;
-	int *nwordsp;
-	char **ret;
-{
-	int nwords;
-	int prefix_len;
-	char **words;
-
-	nwords = (is_command ? x_command_glob : x_file_glob)(XCF_FULLPATH,
-str, slen, );
-	*nwordsp = nwords;
-	if (nwords == 0) {
-		*ret = (char *) 0;
-		return -1;
-	}
-
-	prefix_len = x_longest_prefix(nwords, words);
-	*ret = str_nsave(words[0], prefix_len, ATEMP);
-	x_free_words(nwords, words);
-	return prefix_len;
-}
-#endif /* 0 */
-
 void
 x_print_expansions(nwords, words, is_command)
 	int nwords;



CVS commit: src/bin/ksh

2017-06-29 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 30 05:18:36 UTC 2017

Modified Files:
src/bin/ksh: edit.c

Log Message:
ksh: Eliminate dead function x_complete_word()


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/bin/ksh/edit.c

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



CVS commit: src/bin/ksh

2017-06-29 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 30 05:14:12 UTC 2017

Modified Files:
src/bin/ksh: expand.h

Log Message:
ksh: Eliminate dead code from expand.h


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/bin/ksh/expand.h

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



CVS commit: src/bin/ksh

2017-06-29 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 30 05:14:12 UTC 2017

Modified Files:
src/bin/ksh: expand.h

Log Message:
ksh: Eliminate dead code from expand.h


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/bin/ksh/expand.h

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

Modified files:

Index: src/bin/ksh/expand.h
diff -u src/bin/ksh/expand.h:1.5 src/bin/ksh/expand.h:1.6
--- src/bin/ksh/expand.h:1.5	Fri Oct 18 19:53:34 2013
+++ src/bin/ksh/expand.h	Fri Jun 30 05:14:12 2017
@@ -1,30 +1,12 @@
-/*	$NetBSD: expand.h,v 1.5 2013/10/18 19:53:34 christos Exp $	*/
+/*	$NetBSD: expand.h,v 1.6 2017/06/30 05:14:12 kamil Exp $	*/
 
 /*
  * Expanding strings
  */
-/* $Id: expand.h,v 1.5 2013/10/18 19:53:34 christos Exp $ */
+/* $Id: expand.h,v 1.6 2017/06/30 05:14:12 kamil Exp $ */
 
 #define X_EXTRA		8	/* this many extra bytes in X string */
 
-#if 0/* Usage */
-	XString xs;
-	char *xp;
-
-	Xinit(xs, xp, 128, ATEMP); /* allocate initial string */
-	while ((c = generate()) {
-		Xcheck(xs, xp);	/* expand string if necessary */
-		Xput(xs, xp, c); /* add character */
-	}
-	return Xclose(xs, xp);	/* resize string */
-/*
- * NOTE:
- * The Xcheck and Xinit macros have a magic + X_EXTRA in the lengths.
- * This is so that you can put up to X_EXTRA characters in a XString
- * before calling Xcheck. (See yylex in lex.c)
- */
-#endif /* 0 */
-
 typedef struct XString {
 	char   *end, *beg;	/* end, begin of string */
 	size_t	len;		/* length */



CVS commit: src/bin/ksh

2017-06-29 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 30 04:44:46 UTC 2017

Modified Files:
src/bin/ksh: sh.h

Log Message:
ksh: Drop old hack for FreeBSD 1.1.5 and CLK_TCK


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/bin/ksh/sh.h

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

Modified files:

Index: src/bin/ksh/sh.h
diff -u src/bin/ksh/sh.h:1.34 src/bin/ksh/sh.h:1.35
--- src/bin/ksh/sh.h:1.34	Fri Jun 30 04:41:19 2017
+++ src/bin/ksh/sh.h	Fri Jun 30 04:44:46 2017
@@ -1,10 +1,10 @@
-/*	$NetBSD: sh.h,v 1.34 2017/06/30 04:41:19 kamil Exp $	*/
+/*	$NetBSD: sh.h,v 1.35 2017/06/30 04:44:46 kamil Exp $	*/
 
 /*
  * Public Domain Bourne/Korn shell
  */
 
-/* $Id: sh.h,v 1.34 2017/06/30 04:41:19 kamil Exp $ */
+/* $Id: sh.h,v 1.35 2017/06/30 04:44:46 kamil Exp $ */
 
 #include "config.h"	/* system and option configuration info */
 
@@ -47,9 +47,6 @@
 # endif /* L_SET */
 #endif /* !SEEK_SET */
 
-/* Some machines (eg, FreeBSD 1.1.5) define CLK_TCK in limits.h
- * (ksh_limval.h assumes limits has been included, if available)
- */
 #include 
 
 #include 



CVS commit: src/bin/ksh

2017-06-29 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 30 04:44:46 UTC 2017

Modified Files:
src/bin/ksh: sh.h

Log Message:
ksh: Drop old hack for FreeBSD 1.1.5 and CLK_TCK


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/bin/ksh/sh.h

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



CVS commit: src/bin/ksh

2017-06-29 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 30 04:41:19 UTC 2017

Modified Files:
src/bin/ksh: c_ksh.c c_sh.c c_test.c edit.c edit.h emacs.c eval.c
exec.c expr.c history.c io.c jobs.c lex.c mail.c main.c misc.c
proto.h sh.h syn.c trap.c tty.c var.c vi.c

Log Message:
ksh: Upgrade to C99 

This shell already used C99 functions.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/bin/ksh/c_ksh.c
cvs rdiff -u -r1.22 -r1.23 src/bin/ksh/c_sh.c src/bin/ksh/exec.c \
src/bin/ksh/misc.c
cvs rdiff -u -r1.8 -r1.9 src/bin/ksh/c_test.c src/bin/ksh/proto.h \
src/bin/ksh/tty.c
cvs rdiff -u -r1.31 -r1.32 src/bin/ksh/edit.c
cvs rdiff -u -r1.3 -r1.4 src/bin/ksh/edit.h
cvs rdiff -u -r1.36 -r1.37 src/bin/ksh/emacs.c
cvs rdiff -u -r1.21 -r1.22 src/bin/ksh/eval.c src/bin/ksh/main.c
cvs rdiff -u -r1.9 -r1.10 src/bin/ksh/expr.c src/bin/ksh/syn.c
cvs rdiff -u -r1.16 -r1.17 src/bin/ksh/history.c src/bin/ksh/io.c
cvs rdiff -u -r1.18 -r1.19 src/bin/ksh/jobs.c
cvs rdiff -u -r1.20 -r1.21 src/bin/ksh/lex.c
cvs rdiff -u -r1.7 -r1.8 src/bin/ksh/mail.c
cvs rdiff -u -r1.33 -r1.34 src/bin/ksh/sh.h
cvs rdiff -u -r1.12 -r1.13 src/bin/ksh/trap.c
cvs rdiff -u -r1.19 -r1.20 src/bin/ksh/var.c
cvs rdiff -u -r1.17 -r1.18 src/bin/ksh/vi.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/ksh/c_ksh.c
diff -u src/bin/ksh/c_ksh.c:1.25 src/bin/ksh/c_ksh.c:1.26
--- src/bin/ksh/c_ksh.c:1.25	Fri Jun 30 03:56:12 2017
+++ src/bin/ksh/c_ksh.c	Fri Jun 30 04:41:19 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: c_ksh.c,v 1.25 2017/06/30 03:56:12 kamil Exp $	*/
+/*	$NetBSD: c_ksh.c,v 1.26 2017/06/30 04:41:19 kamil Exp $	*/
 
 /*
  * built-in Korn commands: c_*
@@ -6,7 +6,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: c_ksh.c,v 1.25 2017/06/30 03:56:12 kamil Exp $");
+__RCSID("$NetBSD: c_ksh.c,v 1.26 2017/06/30 04:41:19 kamil Exp $");
 #endif
 
 #include 
@@ -717,7 +717,7 @@ c_typeset(wp)
 		for (i = builtin_opt.optind; wp[i]; i++) {
 			if (func) {
 f = findfunc(wp[i], hash(wp[i]),
-	 (fset_AL) ? TRUE : FALSE);
+	 (fset_AL) ? true : false);
 if (!f) {
 	/* at ksh does ++rval: bogus */
 	rval = 1;
@@ -1173,7 +1173,7 @@ c_kill(wp)
 	/* assume old style options if -digits or -UPPERCASE */
 	if ((p = wp[1]) && *p == '-'
 	&& (digit(p[1]) || isupper((unsigned char)p[1]))) {
-		if (!(t = gettrap(p + 1, TRUE))) {
+		if (!(t = gettrap(p + 1, true))) {
 			bi_errorf("bad signal `%s'", p + 1);
 			return 1;
 		}
@@ -1187,7 +1187,7 @@ c_kill(wp)
 lflag = 1;
 break;
 			  case 's':
-if (!(t = gettrap(builtin_opt.optarg, TRUE))) {
+if (!(t = gettrap(builtin_opt.optarg, true))) {
 	bi_errorf("bad signal `%s'",
 		builtin_opt.optarg);
 	return 1;
@@ -1311,7 +1311,7 @@ c_getopts(wp)
 		bi_errorf("missing name argument");
 		return 1;
 	}
-	if (!*var || *skip_varname(var, TRUE)) {
+	if (!*var || *skip_varname(var, true)) {
 		bi_errorf("%s: is not an identifier", var);
 		return 1;
 	}

Index: src/bin/ksh/c_sh.c
diff -u src/bin/ksh/c_sh.c:1.22 src/bin/ksh/c_sh.c:1.23
--- src/bin/ksh/c_sh.c:1.22	Fri Jun 30 03:56:12 2017
+++ src/bin/ksh/c_sh.c	Fri Jun 30 04:41:19 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: c_sh.c,v 1.22 2017/06/30 03:56:12 kamil Exp $	*/
+/*	$NetBSD: c_sh.c,v 1.23 2017/06/30 04:41:19 kamil Exp $	*/
 
 /*
  * built-in Bourne commands
@@ -6,7 +6,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: c_sh.c,v 1.22 2017/06/30 03:56:12 kamil Exp $");
+__RCSID("$NetBSD: c_sh.c,v 1.23 2017/06/30 04:41:19 kamil Exp $");
 #endif
 
 #include 
@@ -464,7 +464,7 @@ c_eval(wp)
 		exstat = subst_exstat;
 	}
 
-	rv = shell(s, FALSE);
+	rv = shell(s, false);
 	afree(s, ATEMP);
 	return rv;
 }
@@ -515,13 +515,13 @@ c_trap(wp)
 	 * command 'exit' isn't confused with the pseudo-signal
 	 * 'EXIT'.
 	 */
-	s = (gettrap(*wp, FALSE) == NULL) ? *wp++ : NULL; /* get command */
+	s = (gettrap(*wp, false) == NULL) ? *wp++ : NULL; /* get command */
 	if (s != NULL && s[0] == '-' && s[1] == '\0')
 		s = NULL;
 
 	/* set/clear traps */
 	while (*wp != NULL) {
-		p = gettrap(*wp++, TRUE);
+		p = gettrap(*wp++, true);
 		if (p == NULL) {
 			bi_errorf("bad signal %s", wp[-1]);
 			return 1;
@@ -546,7 +546,7 @@ c_exitreturn(wp)
 	if (arg) {
 	if (!getn(arg, )) {
 		exstat = 1;
-		warningf(TRUE, "%s: bad number", arg);
+		warningf(true, "%s: bad number", arg);
 	} else
 		exstat = n;
 	}
@@ -612,7 +612,7 @@ c_brkcont(wp)
 		 * scripts, but don't generate an error (ie, keep going).
 		 */
 		if (n == quit) {
-			warningf(TRUE, "%s: cannot %s", wp[0], wp[0]);
+			warningf(true, "%s: cannot %s", wp[0], wp[0]);
 			return 0;
 		}
 		/* POSIX says if n is too big, the last enclosing loop
@@ -621,7 +621,7 @@ c_brkcont(wp)
 		 */
 		if (last_ep)
 			last_ep->flags &= ~EF_BRKCONT_PASS;
-		warningf(TRUE, "%s: can only %s %d level(s)",
+		warningf(true, "%s: can only %s %d 

CVS commit: src/bin/ksh

2017-06-29 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 30 04:41:19 UTC 2017

Modified Files:
src/bin/ksh: c_ksh.c c_sh.c c_test.c edit.c edit.h emacs.c eval.c
exec.c expr.c history.c io.c jobs.c lex.c mail.c main.c misc.c
proto.h sh.h syn.c trap.c tty.c var.c vi.c

Log Message:
ksh: Upgrade to C99 

This shell already used C99 functions.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/bin/ksh/c_ksh.c
cvs rdiff -u -r1.22 -r1.23 src/bin/ksh/c_sh.c src/bin/ksh/exec.c \
src/bin/ksh/misc.c
cvs rdiff -u -r1.8 -r1.9 src/bin/ksh/c_test.c src/bin/ksh/proto.h \
src/bin/ksh/tty.c
cvs rdiff -u -r1.31 -r1.32 src/bin/ksh/edit.c
cvs rdiff -u -r1.3 -r1.4 src/bin/ksh/edit.h
cvs rdiff -u -r1.36 -r1.37 src/bin/ksh/emacs.c
cvs rdiff -u -r1.21 -r1.22 src/bin/ksh/eval.c src/bin/ksh/main.c
cvs rdiff -u -r1.9 -r1.10 src/bin/ksh/expr.c src/bin/ksh/syn.c
cvs rdiff -u -r1.16 -r1.17 src/bin/ksh/history.c src/bin/ksh/io.c
cvs rdiff -u -r1.18 -r1.19 src/bin/ksh/jobs.c
cvs rdiff -u -r1.20 -r1.21 src/bin/ksh/lex.c
cvs rdiff -u -r1.7 -r1.8 src/bin/ksh/mail.c
cvs rdiff -u -r1.33 -r1.34 src/bin/ksh/sh.h
cvs rdiff -u -r1.12 -r1.13 src/bin/ksh/trap.c
cvs rdiff -u -r1.19 -r1.20 src/bin/ksh/var.c
cvs rdiff -u -r1.17 -r1.18 src/bin/ksh/vi.c

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



CVS commit: src/bin/ksh

2017-06-29 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 30 04:30:26 UTC 2017

Modified Files:
src/bin/ksh: main.c sh.h

Log Message:
ksh: Eliminate dead MEM_DEBUG sections, there is missing code for it

MEM_DEBUG used to contain malloc(3) debugging facilities.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/bin/ksh/main.c
cvs rdiff -u -r1.32 -r1.33 src/bin/ksh/sh.h

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

Modified files:

Index: src/bin/ksh/main.c
diff -u src/bin/ksh/main.c:1.20 src/bin/ksh/main.c:1.21
--- src/bin/ksh/main.c:1.20	Fri Jun 30 03:56:12 2017
+++ src/bin/ksh/main.c	Fri Jun 30 04:30:26 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.20 2017/06/30 03:56:12 kamil Exp $	*/
+/*	$NetBSD: main.c,v 1.21 2017/06/30 04:30:26 kamil Exp $	*/
 
 /*
  * startup, main loop, environments and error handling
@@ -10,7 +10,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: main.c,v 1.20 2017/06/30 03:56:12 kamil Exp $");
+__RCSID("$NetBSD: main.c,v 1.21 2017/06/30 04:30:26 kamil Exp $");
 #endif
 
 
@@ -102,11 +102,6 @@ main(int argc, char *argv[])
 	struct env env;
 	pid_t ppid;
 
-#ifdef MEM_DEBUG
-	chmem_set_defaults("ct", 1);
-	/* chmem_push("+c", 1); */
-#endif /* MEM_DEBUG */
-
 	/* make sure argv[] is sane */
 	if (!*argv) {
 		static const char	*empty_argv[] = {
@@ -711,9 +706,6 @@ quitenv()
 	kill(0, sig);
 }
 			}
-#ifdef MEM_DEBUG
-			chmem_allfree();
-#endif /* MEM_DEBUG */
 		}
 		exit(exstat);
 	}

Index: src/bin/ksh/sh.h
diff -u src/bin/ksh/sh.h:1.32 src/bin/ksh/sh.h:1.33
--- src/bin/ksh/sh.h:1.32	Fri Jun 30 04:22:22 2017
+++ src/bin/ksh/sh.h	Fri Jun 30 04:30:26 2017
@@ -1,10 +1,10 @@
-/*	$NetBSD: sh.h,v 1.32 2017/06/30 04:22:22 kamil Exp $	*/
+/*	$NetBSD: sh.h,v 1.33 2017/06/30 04:30:26 kamil Exp $	*/
 
 /*
  * Public Domain Bourne/Korn shell
  */
 
-/* $Id: sh.h,v 1.32 2017/06/30 04:22:22 kamil Exp $ */
+/* $Id: sh.h,v 1.33 2017/06/30 04:30:26 kamil Exp $ */
 
 #include "config.h"	/* system and option configuration info */
 
@@ -205,10 +205,6 @@ EXTERN	Area	aperm;		/* permanent object 
 #define	APERM	
 #define	ATEMP	>area
 
-#ifdef MEM_DEBUG
-# include "chmem.h" /* a debugging front end for malloc et. al. */
-#endif /* MEM_DEBUG */
-
 #ifdef KSH_DEBUG
 # define kshdebug_init()	kshdebug_init_()
 # define kshdebug_printf(a)	kshdebug_printf_ a



CVS commit: src/bin/ksh

2017-06-29 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 30 04:30:26 UTC 2017

Modified Files:
src/bin/ksh: main.c sh.h

Log Message:
ksh: Eliminate dead MEM_DEBUG sections, there is missing code for it

MEM_DEBUG used to contain malloc(3) debugging facilities.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/bin/ksh/main.c
cvs rdiff -u -r1.32 -r1.33 src/bin/ksh/sh.h

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



CVS commit: src/bin/ksh

2017-06-29 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 30 04:22:22 UTC 2017

Modified Files:
src/bin/ksh: Makefile config.h sh.h
Removed Files:
src/bin/ksh: sigact.c sigact.h

Log Message:
ksh: Drop support for OSes without POSIX sigaction(2)


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/bin/ksh/Makefile
cvs rdiff -u -r1.52 -r1.53 src/bin/ksh/config.h
cvs rdiff -u -r1.31 -r1.32 src/bin/ksh/sh.h
cvs rdiff -u -r1.7 -r0 src/bin/ksh/sigact.c
cvs rdiff -u -r1.3 -r0 src/bin/ksh/sigact.h

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



CVS commit: src/bin/ksh

2017-06-29 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 30 04:22:22 UTC 2017

Modified Files:
src/bin/ksh: Makefile config.h sh.h
Removed Files:
src/bin/ksh: sigact.c sigact.h

Log Message:
ksh: Drop support for OSes without POSIX sigaction(2)


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/bin/ksh/Makefile
cvs rdiff -u -r1.52 -r1.53 src/bin/ksh/config.h
cvs rdiff -u -r1.31 -r1.32 src/bin/ksh/sh.h
cvs rdiff -u -r1.7 -r0 src/bin/ksh/sigact.c
cvs rdiff -u -r1.3 -r0 src/bin/ksh/sigact.h

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

Modified files:

Index: src/bin/ksh/Makefile
diff -u src/bin/ksh/Makefile:1.33 src/bin/ksh/Makefile:1.34
--- src/bin/ksh/Makefile:1.33	Wed Mar 16 23:02:23 2016
+++ src/bin/ksh/Makefile	Fri Jun 30 04:22:22 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.33 2016/03/16 23:02:23 christos Exp $
+#	$NetBSD: Makefile,v 1.34 2017/06/30 04:22:22 kamil Exp $
 
 WARNS=3
 CWARNFLAGS.clang+=	-Wno-error=cast-qual
@@ -10,8 +10,8 @@ CPPFLAGS+=	-I.
 PROG=	ksh
 SRCS=	alloc.c c_ksh.c c_sh.c c_test.c c_ulimit.c edit.c emacs.c \
 	eval.c exec.c expr.c history.c io.c jobs.c lex.c mail.c \
-	main.c misc.c path.c shf.c sigact.c syn.c table.c trap.c \
-	tree.c tty.c var.c version.c vi.c
+	main.c misc.c path.c shf.c syn.c table.c trap.c tree.c tty.c \
+	var.c version.c vi.c
 DPSRCS=	emacs.out siglist.out
 .if (${MKMAN} != "no")
 DPSRCS+=ksh.1

Index: src/bin/ksh/config.h
diff -u src/bin/ksh/config.h:1.52 src/bin/ksh/config.h:1.53
--- src/bin/ksh/config.h:1.52	Fri Jun 30 04:11:57 2017
+++ src/bin/ksh/config.h	Fri Jun 30 04:22:22 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: config.h,v 1.52 2017/06/30 04:11:57 kamil Exp $	*/
+/*	$NetBSD: config.h,v 1.53 2017/06/30 04:22:22 kamil Exp $	*/
 
 /* config.h.  Generated automatically by configure.  */
 /* config.h.in.  Generated automatically from configure.in by autoheader.  */
@@ -30,9 +30,6 @@
 /* Define as the return value of signal handlers (0 or ).  */
 #define RETSIGVAL 
 
-/* Define to use the fake posix signal routines (sigact.[ch]) */
-/* #undef USE_FAKE_SIGACT */
-
 /* Define if you have bsd versions of the setpgrp() and getpgrp() routines */
 /* #undef BSD_PGRP */
 

Index: src/bin/ksh/sh.h
diff -u src/bin/ksh/sh.h:1.31 src/bin/ksh/sh.h:1.32
--- src/bin/ksh/sh.h:1.31	Fri Jun 30 02:51:14 2017
+++ src/bin/ksh/sh.h	Fri Jun 30 04:22:22 2017
@@ -1,10 +1,10 @@
-/*	$NetBSD: sh.h,v 1.31 2017/06/30 02:51:14 kamil Exp $	*/
+/*	$NetBSD: sh.h,v 1.32 2017/06/30 04:22:22 kamil Exp $	*/
 
 /*
  * Public Domain Bourne/Korn shell
  */
 
-/* $Id: sh.h,v 1.31 2017/06/30 02:51:14 kamil Exp $ */
+/* $Id: sh.h,v 1.32 2017/06/30 04:22:22 kamil Exp $ */
 
 #include "config.h"	/* system and option configuration info */
 
@@ -80,10 +80,6 @@
 
 typedef	RETSIGTYPE (*handler_t) ARGS((int));	/* signal handler */
 
-#ifdef USE_FAKE_SIGACT
-# include "sigact.h"			/* use sjg's fake sigaction() */
-#endif
-
 #ifdef HAVE_PATHS_H
 # include 
 #endif /* HAVE_PATHS_H */



CVS commit: src/bin/ksh

2017-06-29 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 30 04:11:57 UTC 2017

Modified Files:
src/bin/ksh: c_test.c config.h

Log Message:
ksh: Drop support for OSes that don't map /dev/fd


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/bin/ksh/c_test.c
cvs rdiff -u -r1.51 -r1.52 src/bin/ksh/config.h

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

Modified files:

Index: src/bin/ksh/c_test.c
diff -u src/bin/ksh/c_test.c:1.7 src/bin/ksh/c_test.c:1.8
--- src/bin/ksh/c_test.c:1.7	Fri Jun 30 03:56:12 2017
+++ src/bin/ksh/c_test.c	Fri Jun 30 04:11:57 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: c_test.c,v 1.7 2017/06/30 03:56:12 kamil Exp $	*/
+/*	$NetBSD: c_test.c,v 1.8 2017/06/30 04:11:57 kamil Exp $	*/
 
 /*
  * test(1); version 7-like  --  author Erik Baalbergen
@@ -11,7 +11,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: c_test.c,v 1.7 2017/06/30 03:56:12 kamil Exp $");
+__RCSID("$NetBSD: c_test.c,v 1.8 2017/06/30 04:11:57 kamil Exp $");
 #endif
 
 #include 
@@ -422,19 +422,11 @@ test_eval(te, op, opnd1, opnd2, do_eval)
 	return 1;
 }
 
-/* Nasty kludge to handle Korn's bizarre /dev/fd hack */
 static int
 test_stat(pathx, statb)
 	const char *pathx;
 	struct stat *statb;
 {
-#if !defined(HAVE_DEV_FD)
-	int fd;
-
-	if (strncmp(pathx, "/dev/fd/", 8) == 0 && getn(pathx + 8, ))
-		return fstat(fd, statb);
-#endif /* !HAVE_DEV_FD */
-
 	return stat(pathx, statb);
 }
 
@@ -448,22 +440,6 @@ test_eaccess(pathx, mode)
 {
 	int res;
 
-#if !defined(HAVE_DEV_FD)
-	int fd;
-
-	/* Note: doesn't handle //dev/fd, etc.. (this is ok) */
-	if (strncmp(pathx, "/dev/fd/", 8) == 0 && getn(pathx + 8, )) {
-		int flags;
-
-		if ((flags = fcntl(fd, F_GETFL, 0)) < 0
-		|| (mode & X_OK)
-		|| ((mode & W_OK) && (flags & O_ACCMODE) == O_RDONLY)
-		|| ((mode & R_OK) && (flags & O_ACCMODE) == O_WRONLY))
-			return -1;
-		return 0;
-	}
-#endif /* !HAVE_DEV_FD */
-
 	res = eaccess(pathx, mode);
 	/*
 	 * On most (all?) unixes, access() says everything is executable for

Index: src/bin/ksh/config.h
diff -u src/bin/ksh/config.h:1.51 src/bin/ksh/config.h:1.52
--- src/bin/ksh/config.h:1.51	Fri Jun 30 03:56:12 2017
+++ src/bin/ksh/config.h	Fri Jun 30 04:11:57 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: config.h,v 1.51 2017/06/30 03:56:12 kamil Exp $	*/
+/*	$NetBSD: config.h,v 1.52 2017/06/30 04:11:57 kamil Exp $	*/
 
 /* config.h.  Generated automatically by configure.  */
 /* config.h.in.  Generated automatically from configure.in by autoheader.  */
@@ -69,9 +69,6 @@
 /* Define if the pgrp of setpgrp() can't be the pid of a zombie process */
 /* #undef NEED_PGRP_SYNC */
 
-/* Define if your OS maps references to /dev/fd/n to file descriptor n */
-#define HAVE_DEV_FD 1
-
 /* Default PATH */
 #ifdef RESCUEDIR
 #define DEFAULT_PATH RESCUEDIR ":/bin:/usr/bin:/sbin:/usr/sbin"



CVS commit: src/bin/ksh

2017-06-29 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 30 04:11:57 UTC 2017

Modified Files:
src/bin/ksh: c_test.c config.h

Log Message:
ksh: Drop support for OSes that don't map /dev/fd


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/bin/ksh/c_test.c
cvs rdiff -u -r1.51 -r1.52 src/bin/ksh/config.h

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



CVS commit: src/bin/ksh

2017-06-29 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 30 04:01:48 UTC 2017

Modified Files:
src/bin/ksh: proto.h

Log Message:
ksh: Drop old hack fo SunOS 4.1.x (1990-1994)


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/bin/ksh/proto.h

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

Modified files:

Index: src/bin/ksh/proto.h
diff -u src/bin/ksh/proto.h:1.7 src/bin/ksh/proto.h:1.8
--- src/bin/ksh/proto.h:1.7	Sun Jun 26 19:09:00 2005
+++ src/bin/ksh/proto.h	Fri Jun 30 04:01:48 2017
@@ -1,9 +1,9 @@
-/*	$NetBSD: proto.h,v 1.7 2005/06/26 19:09:00 christos Exp $	*/
+/*	$NetBSD: proto.h,v 1.8 2017/06/30 04:01:48 kamil Exp $	*/
 
 /*
  * prototypes for PD-KSH
  * originally generated using "cproto.c 3.5 92/04/11 19:28:01 cthuang "
- * $Id: proto.h,v 1.7 2005/06/26 19:09:00 christos Exp $
+ * $Id: proto.h,v 1.8 2017/06/30 04:01:48 kamil Exp $
  */
 
 /* alloc.c */
@@ -273,26 +273,3 @@ char *	arrayname	ARGS((const char *));
 voidset_array	ARGS((const char *, int, char **));
 /* version.c */
 /* vi.c: see edit.h */
-
-
-/* Hack to avoid billions of compile warnings on SunOS 4.1.x */
-#if defined(MUN) && defined(sun) && !defined(__svr4__)
-extern void bcopy ARGS((const void *, void *, size_t));
-extern intclose ARGS((FILE *));
-extern intprintf ARGS((FILE *, const char *, ...));
-extern intread ARGS((void *, int, int, FILE *));
-extern int ioctl ARGS((int, int, void *));
-extern int killpg ARGS((int, int));
-extern int nice ARGS((int));
-extern int readlink ARGS((const char *, char *, int));
-extern int setpgrp ARGS((int, int));
-extern int strcasecmp ARGS((const char *, const char *));
-extern int tolower ARGS((int));
-extern int toupper ARGS((int));
-/*  Include files aren't included yet */
-extern int getrlimit ARGS(( /* int, struct rlimit * */ ));
-extern int getrusage ARGS(( /* int, struct rusage * */ ));
-extern int gettimeofday ARGS(( /* struct timeval *, struct timezone * */ ));
-extern int setrlimit ARGS(( /* int, struct rlimit * */ ));
-extern int lstat ARGS(( /* const char *, struct stat * */ ));
-#endif



CVS commit: src/bin/ksh

2017-06-29 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 30 04:01:48 UTC 2017

Modified Files:
src/bin/ksh: proto.h

Log Message:
ksh: Drop old hack fo SunOS 4.1.x (1990-1994)


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/bin/ksh/proto.h

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



CVS commit: src/bin/ksh

2017-06-29 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 30 03:56:12 UTC 2017

Modified Files:
src/bin/ksh: c_ksh.c c_sh.c c_test.c config.h edit.c emacs.c eval.c
exec.c history.c io.c jobs.c mail.c main.c path.c shf.c tty.c var.c
vi.c
Removed Files:
src/bin/ksh: ksh_stat.h

Log Message:
ksh: Drop support for systems without 

In future the order of includes will be normalized with KNF.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/bin/ksh/c_ksh.c
cvs rdiff -u -r1.21 -r1.22 src/bin/ksh/c_sh.c src/bin/ksh/exec.c
cvs rdiff -u -r1.6 -r1.7 src/bin/ksh/c_test.c src/bin/ksh/mail.c
cvs rdiff -u -r1.50 -r1.51 src/bin/ksh/config.h
cvs rdiff -u -r1.30 -r1.31 src/bin/ksh/edit.c
cvs rdiff -u -r1.35 -r1.36 src/bin/ksh/emacs.c
cvs rdiff -u -r1.20 -r1.21 src/bin/ksh/eval.c
cvs rdiff -u -r1.15 -r1.16 src/bin/ksh/history.c src/bin/ksh/io.c
cvs rdiff -u -r1.17 -r1.18 src/bin/ksh/jobs.c
cvs rdiff -u -r1.3 -r0 src/bin/ksh/ksh_stat.h
cvs rdiff -u -r1.19 -r1.20 src/bin/ksh/main.c
cvs rdiff -u -r1.12 -r1.13 src/bin/ksh/path.c src/bin/ksh/shf.c
cvs rdiff -u -r1.7 -r1.8 src/bin/ksh/tty.c
cvs rdiff -u -r1.18 -r1.19 src/bin/ksh/var.c
cvs rdiff -u -r1.16 -r1.17 src/bin/ksh/vi.c

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



CVS commit: src/bin/ksh

2017-06-29 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 30 03:56:12 UTC 2017

Modified Files:
src/bin/ksh: c_ksh.c c_sh.c c_test.c config.h edit.c emacs.c eval.c
exec.c history.c io.c jobs.c mail.c main.c path.c shf.c tty.c var.c
vi.c
Removed Files:
src/bin/ksh: ksh_stat.h

Log Message:
ksh: Drop support for systems without 

In future the order of includes will be normalized with KNF.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/bin/ksh/c_ksh.c
cvs rdiff -u -r1.21 -r1.22 src/bin/ksh/c_sh.c src/bin/ksh/exec.c
cvs rdiff -u -r1.6 -r1.7 src/bin/ksh/c_test.c src/bin/ksh/mail.c
cvs rdiff -u -r1.50 -r1.51 src/bin/ksh/config.h
cvs rdiff -u -r1.30 -r1.31 src/bin/ksh/edit.c
cvs rdiff -u -r1.35 -r1.36 src/bin/ksh/emacs.c
cvs rdiff -u -r1.20 -r1.21 src/bin/ksh/eval.c
cvs rdiff -u -r1.15 -r1.16 src/bin/ksh/history.c src/bin/ksh/io.c
cvs rdiff -u -r1.17 -r1.18 src/bin/ksh/jobs.c
cvs rdiff -u -r1.3 -r0 src/bin/ksh/ksh_stat.h
cvs rdiff -u -r1.19 -r1.20 src/bin/ksh/main.c
cvs rdiff -u -r1.12 -r1.13 src/bin/ksh/path.c src/bin/ksh/shf.c
cvs rdiff -u -r1.7 -r1.8 src/bin/ksh/tty.c
cvs rdiff -u -r1.18 -r1.19 src/bin/ksh/var.c
cvs rdiff -u -r1.16 -r1.17 src/bin/ksh/vi.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/ksh/c_ksh.c
diff -u src/bin/ksh/c_ksh.c:1.24 src/bin/ksh/c_ksh.c:1.25
--- src/bin/ksh/c_ksh.c:1.24	Thu Jun 22 19:41:07 2017
+++ src/bin/ksh/c_ksh.c	Fri Jun 30 03:56:12 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: c_ksh.c,v 1.24 2017/06/22 19:41:07 kamil Exp $	*/
+/*	$NetBSD: c_ksh.c,v 1.25 2017/06/30 03:56:12 kamil Exp $	*/
 
 /*
  * built-in Korn commands: c_*
@@ -6,13 +6,14 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: c_ksh.c,v 1.24 2017/06/22 19:41:07 kamil Exp $");
+__RCSID("$NetBSD: c_ksh.c,v 1.25 2017/06/30 03:56:12 kamil Exp $");
 #endif
 
-#include "sh.h"
-#include "ksh_stat.h"
+#include 
 #include 
 
+#include "sh.h"
+
 int
 c_cd(wp)
 	char	**wp;

Index: src/bin/ksh/c_sh.c
diff -u src/bin/ksh/c_sh.c:1.21 src/bin/ksh/c_sh.c:1.22
--- src/bin/ksh/c_sh.c:1.21	Fri Jun 30 03:43:57 2017
+++ src/bin/ksh/c_sh.c	Fri Jun 30 03:56:12 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: c_sh.c,v 1.21 2017/06/30 03:43:57 kamil Exp $	*/
+/*	$NetBSD: c_sh.c,v 1.22 2017/06/30 03:56:12 kamil Exp $	*/
 
 /*
  * built-in Bourne commands
@@ -6,16 +6,15 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: c_sh.c,v 1.21 2017/06/30 03:43:57 kamil Exp $");
+__RCSID("$NetBSD: c_sh.c,v 1.22 2017/06/30 03:56:12 kamil Exp $");
 #endif
 
+#include 
 #include 
 #include 
 #include 
 
 #include "sh.h"
-#include "ksh_stat.h" 	/* umask() */
-
 
 static	char *clocktos ARGS((clock_t t));
 
Index: src/bin/ksh/exec.c
diff -u src/bin/ksh/exec.c:1.21 src/bin/ksh/exec.c:1.22
--- src/bin/ksh/exec.c:1.21	Fri Jun 30 02:38:10 2017
+++ src/bin/ksh/exec.c	Fri Jun 30 03:56:12 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: exec.c,v 1.21 2017/06/30 02:38:10 kamil Exp $	*/
+/*	$NetBSD: exec.c,v 1.22 2017/06/30 03:56:12 kamil Exp $	*/
 
 /*
  * execute command tree
@@ -6,14 +6,14 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: exec.c,v 1.21 2017/06/30 02:38:10 kamil Exp $");
+__RCSID("$NetBSD: exec.c,v 1.22 2017/06/30 03:56:12 kamil Exp $");
 #endif
 
+#include 
+#include 
 
 #include "sh.h"
 #include "c_test.h"
-#include 
-#include "ksh_stat.h"
 
 /* Does ps4 get parameter substitutions done? */
 #ifdef KSH

Index: src/bin/ksh/c_test.c
diff -u src/bin/ksh/c_test.c:1.6 src/bin/ksh/c_test.c:1.7
--- src/bin/ksh/c_test.c:1.6	Sun Jun 26 19:09:00 2005
+++ src/bin/ksh/c_test.c	Fri Jun 30 03:56:12 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: c_test.c,v 1.6 2005/06/26 19:09:00 christos Exp $	*/
+/*	$NetBSD: c_test.c,v 1.7 2017/06/30 03:56:12 kamil Exp $	*/
 
 /*
  * test(1); version 7-like  --  author Erik Baalbergen
@@ -11,12 +11,12 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: c_test.c,v 1.6 2005/06/26 19:09:00 christos Exp $");
+__RCSID("$NetBSD: c_test.c,v 1.7 2017/06/30 03:56:12 kamil Exp $");
 #endif
 
+#include 
 
 #include "sh.h"
-#include "ksh_stat.h"
 #include "c_test.h"
 
 /* test(1) accepts the following grammar:
Index: src/bin/ksh/mail.c
diff -u src/bin/ksh/mail.c:1.6 src/bin/ksh/mail.c:1.7
--- src/bin/ksh/mail.c:1.6	Fri Jun 30 03:43:57 2017
+++ src/bin/ksh/mail.c	Fri Jun 30 03:56:12 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: mail.c,v 1.6 2017/06/30 03:43:57 kamil Exp $	*/
+/*	$NetBSD: mail.c,v 1.7 2017/06/30 03:56:12 kamil Exp $	*/
 
 /*
  * Mailbox checking code by Robert J. Gibson, adapted for PD ksh by
@@ -7,17 +7,17 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: mail.c,v 1.6 2017/06/30 03:43:57 kamil Exp $");
+__RCSID("$NetBSD: mail.c,v 1.7 2017/06/30 03:56:12 kamil Exp $");
 #endif
 
 #include "config.h"
 
 #ifdef KSH
+#include 
 #include 
 #include 
 
 #include "sh.h"
-#include "ksh_stat.h"
 
 #define MBMESSAGE	"You have mail in $_"
 

Index: src/bin/ksh/config.h
diff -u src/bin/ksh/config.h:1.50 

CVS commit: src/bin/ksh

2017-06-29 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 30 03:43:57 UTC 2017

Modified Files:
src/bin/ksh: c_sh.c c_ulimit.c config.h mail.c main.c var.c
Removed Files:
src/bin/ksh: ksh_time.h

Log Message:
ksh: Drop support for systems with broken  / 


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/bin/ksh/c_sh.c
cvs rdiff -u -r1.15 -r1.16 src/bin/ksh/c_ulimit.c
cvs rdiff -u -r1.49 -r1.50 src/bin/ksh/config.h
cvs rdiff -u -r1.2 -r0 src/bin/ksh/ksh_time.h
cvs rdiff -u -r1.5 -r1.6 src/bin/ksh/mail.c
cvs rdiff -u -r1.18 -r1.19 src/bin/ksh/main.c
cvs rdiff -u -r1.17 -r1.18 src/bin/ksh/var.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/ksh/c_sh.c
diff -u src/bin/ksh/c_sh.c:1.20 src/bin/ksh/c_sh.c:1.21
--- src/bin/ksh/c_sh.c:1.20	Fri Jun 30 03:23:18 2017
+++ src/bin/ksh/c_sh.c	Fri Jun 30 03:43:57 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: c_sh.c,v 1.20 2017/06/30 03:23:18 kamil Exp $	*/
+/*	$NetBSD: c_sh.c,v 1.21 2017/06/30 03:43:57 kamil Exp $	*/
 
 /*
  * built-in Bourne commands
@@ -6,14 +6,15 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: c_sh.c,v 1.20 2017/06/30 03:23:18 kamil Exp $");
+__RCSID("$NetBSD: c_sh.c,v 1.21 2017/06/30 03:43:57 kamil Exp $");
 #endif
 
+#include 
 #include 
+#include 
 
 #include "sh.h"
 #include "ksh_stat.h" 	/* umask() */
-#include "ksh_time.h"
 
 
 static	char *clocktos ARGS((clock_t t));

Index: src/bin/ksh/c_ulimit.c
diff -u src/bin/ksh/c_ulimit.c:1.15 src/bin/ksh/c_ulimit.c:1.16
--- src/bin/ksh/c_ulimit.c:1.15	Thu Jun 22 14:20:46 2017
+++ src/bin/ksh/c_ulimit.c	Fri Jun 30 03:43:57 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: c_ulimit.c,v 1.15 2017/06/22 14:20:46 kamil Exp $	*/
+/*	$NetBSD: c_ulimit.c,v 1.16 2017/06/30 03:43:57 kamil Exp $	*/
 
 /*
 	ulimit -- handle "ulimit" builtin
@@ -20,12 +20,13 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: c_ulimit.c,v 1.15 2017/06/22 14:20:46 kamil Exp $");
+__RCSID("$NetBSD: c_ulimit.c,v 1.16 2017/06/30 03:43:57 kamil Exp $");
 #endif
 
+#include 
+#include 
 
 #include "sh.h"
-#include "ksh_time.h"
 #ifdef HAVE_SYS_RESOURCE_H
 # include 
 #endif /* HAVE_SYS_RESOURCE_H */

Index: src/bin/ksh/config.h
diff -u src/bin/ksh/config.h:1.49 src/bin/ksh/config.h:1.50
--- src/bin/ksh/config.h:1.49	Fri Jun 30 03:35:16 2017
+++ src/bin/ksh/config.h	Fri Jun 30 03:43:57 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: config.h,v 1.49 2017/06/30 03:35:16 kamil Exp $	*/
+/*	$NetBSD: config.h,v 1.50 2017/06/30 03:43:57 kamil Exp $	*/
 
 /* config.h.  Generated automatically by configure.  */
 /* config.h.in.  Generated automatically from configure.in by autoheader.  */
@@ -33,9 +33,6 @@
 /* Define if `sys_siglist' is declared by .  */
 #define SYS_SIGLIST_DECLARED 1
 
-/* Define if you can safely include both  and .  */
-#define TIME_WITH_SYS_TIME 1
-
 /* Define as the return value of signal handlers (0 or ).  */
 #define RETSIGVAL 
 
@@ -57,9 +54,6 @@
 /* Define if C compiler groks __attribute__((...)) (const, noreturn, format) */
 #define HAVE_GCC_FUNC_ATTR 1
 
-/* Define if time() is declared in  */
-#define TIME_DECLARED 1
-
 /* Define if sys_errlist[] and sys_nerr are in the C library */
 #define HAVE_SYS_ERRLIST 1
 
@@ -196,9 +190,6 @@
 /* Define if you have the  header file.  */
 #define HAVE_SYS_RESOURCE_H 1
 
-/* Define if you have the  header file.  */
-#define HAVE_SYS_TIME_H 1
-
 /* Define if you have the  header file.  */
 #define HAVE_ULIMIT_H
 

Index: src/bin/ksh/mail.c
diff -u src/bin/ksh/mail.c:1.5 src/bin/ksh/mail.c:1.6
--- src/bin/ksh/mail.c:1.5	Sun Jan 15 18:16:30 2006
+++ src/bin/ksh/mail.c	Fri Jun 30 03:43:57 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: mail.c,v 1.5 2006/01/15 18:16:30 jschauma Exp $	*/
+/*	$NetBSD: mail.c,v 1.6 2017/06/30 03:43:57 kamil Exp $	*/
 
 /*
  * Mailbox checking code by Robert J. Gibson, adapted for PD ksh by
@@ -7,16 +7,17 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: mail.c,v 1.5 2006/01/15 18:16:30 jschauma Exp $");
+__RCSID("$NetBSD: mail.c,v 1.6 2017/06/30 03:43:57 kamil Exp $");
 #endif
 
-
 #include "config.h"
 
 #ifdef KSH
+#include 
+#include 
+
 #include "sh.h"
 #include "ksh_stat.h"
-#include "ksh_time.h"
 
 #define MBMESSAGE	"You have mail in $_"
 

Index: src/bin/ksh/main.c
diff -u src/bin/ksh/main.c:1.18 src/bin/ksh/main.c:1.19
--- src/bin/ksh/main.c:1.18	Thu Jun 22 14:20:46 2017
+++ src/bin/ksh/main.c	Fri Jun 30 03:43:57 2017
@@ -1,13 +1,15 @@
-/*	$NetBSD: main.c,v 1.18 2017/06/22 14:20:46 kamil Exp $	*/
+/*	$NetBSD: main.c,v 1.19 2017/06/30 03:43:57 kamil Exp $	*/
 
 /*
  * startup, main loop, environments and error handling
  */
 #include 
+#include 
 #include 
+#include 
 
 #ifndef lint
-__RCSID("$NetBSD: main.c,v 1.18 2017/06/22 14:20:46 kamil Exp $");
+__RCSID("$NetBSD: main.c,v 1.19 2017/06/30 03:43:57 kamil Exp $");
 #endif
 
 
@@ -15,7 +17,6 @@ __RCSID("$NetBSD: main.c,v 1.18 2017/06/
 
 #include "sh.h"
 #include "ksh_stat.h"
-#include "ksh_time.h"
 
 extern char 

CVS commit: src/bin/ksh

2017-06-29 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 30 03:43:57 UTC 2017

Modified Files:
src/bin/ksh: c_sh.c c_ulimit.c config.h mail.c main.c var.c
Removed Files:
src/bin/ksh: ksh_time.h

Log Message:
ksh: Drop support for systems with broken  / 


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/bin/ksh/c_sh.c
cvs rdiff -u -r1.15 -r1.16 src/bin/ksh/c_ulimit.c
cvs rdiff -u -r1.49 -r1.50 src/bin/ksh/config.h
cvs rdiff -u -r1.2 -r0 src/bin/ksh/ksh_time.h
cvs rdiff -u -r1.5 -r1.6 src/bin/ksh/mail.c
cvs rdiff -u -r1.18 -r1.19 src/bin/ksh/main.c
cvs rdiff -u -r1.17 -r1.18 src/bin/ksh/var.c

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



CVS commit: src/bin/ksh

2017-06-29 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 30 03:35:16 UTC 2017

Modified Files:
src/bin/ksh: config.h ksh_stat.h

Log Message:
ksh: Drop support for systems without POSIX lstat(2)


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/bin/ksh/config.h
cvs rdiff -u -r1.2 -r1.3 src/bin/ksh/ksh_stat.h

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

Modified files:

Index: src/bin/ksh/config.h
diff -u src/bin/ksh/config.h:1.48 src/bin/ksh/config.h:1.49
--- src/bin/ksh/config.h:1.48	Fri Jun 30 03:32:28 2017
+++ src/bin/ksh/config.h	Fri Jun 30 03:35:16 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: config.h,v 1.48 2017/06/30 03:32:28 kamil Exp $	*/
+/*	$NetBSD: config.h,v 1.49 2017/06/30 03:35:16 kamil Exp $	*/
 
 /* config.h.  Generated automatically by configure.  */
 /* config.h.in.  Generated automatically from configure.in by autoheader.  */
@@ -72,9 +72,6 @@
 /* Define if you have a sane  header file */
 #define HAVE_TERMIOS_H 1
 
-/* Define if you have a lstat() function in your C library */
-#define HAVE_LSTAT 1
-
 /* Define if you have a sane  header file */
 /* #undef HAVE_TERMIO_H */
 

Index: src/bin/ksh/ksh_stat.h
diff -u src/bin/ksh/ksh_stat.h:1.2 src/bin/ksh/ksh_stat.h:1.3
--- src/bin/ksh/ksh_stat.h:1.2	Sun Jan 12 19:12:00 1997
+++ src/bin/ksh/ksh_stat.h	Fri Jun 30 03:35:16 2017
@@ -1,15 +1,11 @@
-/*	$NetBSD: ksh_stat.h,v 1.2 1997/01/12 19:12:00 tls Exp $	*/
+/*	$NetBSD: ksh_stat.h,v 1.3 2017/06/30 03:35:16 kamil Exp $	*/
 
 /* Wrapper around the ugly sys/stat includes/ifdefs */
-/* $NetBSD: ksh_stat.h,v 1.2 1997/01/12 19:12:00 tls Exp $ */
+/* $NetBSD: ksh_stat.h,v 1.3 2017/06/30 03:35:16 kamil Exp $ */
 
 /* assumes  already included */
 #include 
 
-#ifndef HAVE_LSTAT
-# define lstat(path, buf)	stat(path, buf)
-#endif /* HAVE_LSTAT */
-
 #ifdef STAT_MACROS_BROKEN
 # undef S_ISREG
 # undef S_ISDIR



CVS commit: src/bin/ksh

2017-06-29 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 30 03:35:16 UTC 2017

Modified Files:
src/bin/ksh: config.h ksh_stat.h

Log Message:
ksh: Drop support for systems without POSIX lstat(2)


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/bin/ksh/config.h
cvs rdiff -u -r1.2 -r1.3 src/bin/ksh/ksh_stat.h

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



CVS commit: src/bin/ksh

2017-06-29 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 30 03:32:28 UTC 2017

Modified Files:
src/bin/ksh: config.h

Log Message:
ksh: Drop support for systems without POSIX 


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/bin/ksh/config.h

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

Modified files:

Index: src/bin/ksh/config.h
diff -u src/bin/ksh/config.h:1.47 src/bin/ksh/config.h:1.48
--- src/bin/ksh/config.h:1.47	Fri Jun 30 03:23:18 2017
+++ src/bin/ksh/config.h	Fri Jun 30 03:32:28 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: config.h,v 1.47 2017/06/30 03:23:18 kamil Exp $	*/
+/*	$NetBSD: config.h,v 1.48 2017/06/30 03:32:28 kamil Exp $	*/
 
 /* config.h.  Generated automatically by configure.  */
 /* config.h.in.  Generated automatically from configure.in by autoheader.  */
@@ -84,9 +84,6 @@
 /* Define if the pgrp of setpgrp() can't be the pid of a zombie process */
 /* #undef NEED_PGRP_SYNC */
 
-/* Define if you have a POSIX.1 compatible  */
-#define POSIX_SYS_WAIT 1
-
 /* Define if your OS maps references to /dev/fd/n to file descriptor n */
 #define HAVE_DEV_FD 1
 



CVS commit: src/bin/ksh

2017-06-29 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 30 03:32:28 UTC 2017

Modified Files:
src/bin/ksh: config.h

Log Message:
ksh: Drop support for systems without POSIX 


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/bin/ksh/config.h

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



CVS commit: src/bin/ksh

2017-06-29 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 30 03:23:18 UTC 2017

Modified Files:
src/bin/ksh: c_sh.c config.h jobs.c
Removed Files:
src/bin/ksh: ksh_times.h

Log Message:
ksh: Drop support for systems with broken times(3)

This fallback code wouldn't work anyway.

times(3) is an obsolete interface by getrusage(2) and gettimeofday(2).
In future it will be swiched to more modern interfaces.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/bin/ksh/c_sh.c
cvs rdiff -u -r1.46 -r1.47 src/bin/ksh/config.h
cvs rdiff -u -r1.16 -r1.17 src/bin/ksh/jobs.c
cvs rdiff -u -r1.2 -r0 src/bin/ksh/ksh_times.h

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

Modified files:

Index: src/bin/ksh/c_sh.c
diff -u src/bin/ksh/c_sh.c:1.19 src/bin/ksh/c_sh.c:1.20
--- src/bin/ksh/c_sh.c:1.19	Thu Jun 22 14:20:46 2017
+++ src/bin/ksh/c_sh.c	Fri Jun 30 03:23:18 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: c_sh.c,v 1.19 2017/06/22 14:20:46 kamil Exp $	*/
+/*	$NetBSD: c_sh.c,v 1.20 2017/06/30 03:23:18 kamil Exp $	*/
 
 /*
  * built-in Bourne commands
@@ -6,14 +6,15 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: c_sh.c,v 1.19 2017/06/22 14:20:46 kamil Exp $");
+__RCSID("$NetBSD: c_sh.c,v 1.20 2017/06/30 03:23:18 kamil Exp $");
 #endif
 
+#include 
 
 #include "sh.h"
 #include "ksh_stat.h" 	/* umask() */
 #include "ksh_time.h"
-#include "ksh_times.h"
+
 
 static	char *clocktos ARGS((clock_t t));
 
@@ -706,7 +707,7 @@ c_times(wp)
 {
 	struct tms all;
 
-	(void) ksh_times();
+	times();
 	shprintf("Shell: %8ss user ", clocktos(all.tms_utime));
 	shprintf("%8ss system\n", clocktos(all.tms_stime));
 	shprintf("Kids:  %8ss user ", clocktos(all.tms_cutime));
@@ -733,7 +734,7 @@ timex(t, f)
 	extern clock_t j_usrtime, j_systime; /* computed by j_wait */
 	char opts[1];
 
-	t0t = ksh_times();
+	t0t = times();
 	if (t->left) {
 		/*
 		 * Two ways of getting cpu usage of a command: just use t0
@@ -749,7 +750,7 @@ timex(t, f)
 		opts[0] = 0;
 		rv = execute(t->left, f | XTIME);
 		tf |= opts[0];
-		t1t = ksh_times();
+		t1t = times();
 	} else
 		tf = TF_NOARGS;
 

Index: src/bin/ksh/config.h
diff -u src/bin/ksh/config.h:1.46 src/bin/ksh/config.h:1.47
--- src/bin/ksh/config.h:1.46	Fri Jun 30 02:51:14 2017
+++ src/bin/ksh/config.h	Fri Jun 30 03:23:18 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: config.h,v 1.46 2017/06/30 02:51:14 kamil Exp $	*/
+/*	$NetBSD: config.h,v 1.47 2017/06/30 03:23:18 kamil Exp $	*/
 
 /* config.h.  Generated automatically by configure.  */
 /* config.h.in.  Generated automatically from configure.in by autoheader.  */
@@ -78,9 +78,6 @@
 /* Define if you have a sane  header file */
 /* #undef HAVE_TERMIO_H */
 
-/* Define if you don't have times() or if it always returns 0 */
-/* #undef TIMES_BROKEN */
-
 /* Define if opendir() will open non-directory files */
 /* #undef OPENDIR_DOES_NONDIR */
 

Index: src/bin/ksh/jobs.c
diff -u src/bin/ksh/jobs.c:1.16 src/bin/ksh/jobs.c:1.17
--- src/bin/ksh/jobs.c:1.16	Fri Jun 30 02:38:10 2017
+++ src/bin/ksh/jobs.c	Fri Jun 30 03:23:18 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: jobs.c,v 1.16 2017/06/30 02:38:10 kamil Exp $	*/
+/*	$NetBSD: jobs.c,v 1.17 2017/06/30 03:23:18 kamil Exp $	*/
 
 /*
  * Process and job control
@@ -21,14 +21,14 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: jobs.c,v 1.16 2017/06/30 02:38:10 kamil Exp $");
+__RCSID("$NetBSD: jobs.c,v 1.17 2017/06/30 03:23:18 kamil Exp $");
 #endif
 
+#include 
 #include 
 
 #include "sh.h"
 #include "ksh_stat.h"
-#include "ksh_times.h"
 #include "tty.h"
 
 /* Start of system configuration stuff */
@@ -1263,14 +1263,14 @@ j_sigchld(sig)
 			return RETSIGVAL;
 		}
 
-	ksh_times();
+	times();
 	do {
 		pid = waitpid(-1, , (WNOHANG|WUNTRACED));
 
 		if (pid <= 0)	/* return if would block (0) ... */
 			break;	/* ... or no children or interrupted (-1) */
 
-		ksh_times();
+		times();
 
 		/* find job and process structures for this pid */
 		for (j = job_list; j != (Job *) 0; j = j->next)



CVS commit: src/bin/ksh

2017-06-29 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 30 03:23:18 UTC 2017

Modified Files:
src/bin/ksh: c_sh.c config.h jobs.c
Removed Files:
src/bin/ksh: ksh_times.h

Log Message:
ksh: Drop support for systems with broken times(3)

This fallback code wouldn't work anyway.

times(3) is an obsolete interface by getrusage(2) and gettimeofday(2).
In future it will be swiched to more modern interfaces.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/bin/ksh/c_sh.c
cvs rdiff -u -r1.46 -r1.47 src/bin/ksh/config.h
cvs rdiff -u -r1.16 -r1.17 src/bin/ksh/jobs.c
cvs rdiff -u -r1.2 -r0 src/bin/ksh/ksh_times.h

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



CVS commit: src/bin/ksh

2017-06-29 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 30 02:51:14 UTC 2017

Modified Files:
src/bin/ksh: config.h io.c lex.c sh.h shf.c tree.c

Log Message:
ksh: Assume ANSI C prototypes


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/bin/ksh/config.h
cvs rdiff -u -r1.14 -r1.15 src/bin/ksh/io.c
cvs rdiff -u -r1.19 -r1.20 src/bin/ksh/lex.c
cvs rdiff -u -r1.30 -r1.31 src/bin/ksh/sh.h
cvs rdiff -u -r1.11 -r1.12 src/bin/ksh/shf.c
cvs rdiff -u -r1.7 -r1.8 src/bin/ksh/tree.c

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



CVS commit: src/bin/ksh

2017-06-29 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 30 02:51:14 UTC 2017

Modified Files:
src/bin/ksh: config.h io.c lex.c sh.h shf.c tree.c

Log Message:
ksh: Assume ANSI C prototypes


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/bin/ksh/config.h
cvs rdiff -u -r1.14 -r1.15 src/bin/ksh/io.c
cvs rdiff -u -r1.19 -r1.20 src/bin/ksh/lex.c
cvs rdiff -u -r1.30 -r1.31 src/bin/ksh/sh.h
cvs rdiff -u -r1.11 -r1.12 src/bin/ksh/shf.c
cvs rdiff -u -r1.7 -r1.8 src/bin/ksh/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/bin/ksh/config.h
diff -u src/bin/ksh/config.h:1.45 src/bin/ksh/config.h:1.46
--- src/bin/ksh/config.h:1.45	Fri Jun 30 02:38:09 2017
+++ src/bin/ksh/config.h	Fri Jun 30 02:51:14 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: config.h,v 1.45 2017/06/30 02:38:09 kamil Exp $	*/
+/*	$NetBSD: config.h,v 1.46 2017/06/30 02:51:14 kamil Exp $	*/
 
 /* config.h.  Generated automatically by configure.  */
 /* config.h.in.  Generated automatically from configure.in by autoheader.  */
@@ -54,9 +54,6 @@
 /* Define if you don't have setpgrp(), setpgid() or getpgrp() routines */
 /* #undef NO_PGRP */
 
-/* Define if C compiler groks function prototypes */
-#define HAVE_PROTOTYPES 1
-
 /* Define if C compiler groks __attribute__((...)) (const, noreturn, format) */
 #define HAVE_GCC_FUNC_ATTR 1
 

Index: src/bin/ksh/io.c
diff -u src/bin/ksh/io.c:1.14 src/bin/ksh/io.c:1.15
--- src/bin/ksh/io.c:1.14	Fri Jun 23 00:18:01 2017
+++ src/bin/ksh/io.c	Fri Jun 30 02:51:14 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: io.c,v 1.14 2017/06/23 00:18:01 kamil Exp $	*/
+/*	$NetBSD: io.c,v 1.15 2017/06/30 02:51:14 kamil Exp $	*/
 
 /*
  * shell buffered IO and formatted output
@@ -6,7 +6,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: io.c,v 1.14 2017/06/23 00:18:01 kamil Exp $");
+__RCSID("$NetBSD: io.c,v 1.15 2017/06/30 02:51:14 kamil Exp $");
 #endif
 
 
@@ -23,13 +23,7 @@ static int initio_done;
 
 /* A shell error occurred (eg, syntax error, etc.) */
 void
-#ifdef HAVE_PROTOTYPES
 errorf(const char *fmt, ...)
-#else
-errorf(fmt, va_alist)
-	const char *fmt;
-	va_dcl
-#endif
 {
 	va_list va;
 
@@ -48,14 +42,7 @@ errorf(fmt, va_alist)
 
 /* like errorf(), but no unwind is done */
 void
-#ifdef HAVE_PROTOTYPES
 warningf(int fileline, const char *fmt, ...)
-#else
-warningf(fileline, fmt, va_alist)
-	int fileline;
-	const char *fmt;
-	va_dcl
-#endif
 {
 	va_list va;
 
@@ -71,13 +58,7 @@ warningf(fileline, fmt, va_alist)
  * (also unwinds environments for special builtins).
  */
 void
-#ifdef HAVE_PROTOTYPES
 bi_errorf(const char *fmt, ...)
-#else
-bi_errorf(fmt, va_alist)
-	const char *fmt;
-	va_dcl
-#endif
 {
 	va_list va;
 
@@ -108,14 +89,7 @@ bi_errorf(fmt, va_alist)
 
 /* Called when something that shouldn't happen does */
 void
-#ifdef HAVE_PROTOTYPES
 internal_errorf(int jump, const char *fmt, ...)
-#else
-internal_errorf(jump, fmt, va_alist)
-	int jump;
-	const char *fmt;
-	va_dcl
-#endif
 {
 	va_list va;
 
@@ -148,13 +122,7 @@ error_prefix(fileline)
 
 /* printf to shl_out (stderr) with flush */
 void
-#ifdef HAVE_PROTOTYPES
 shellf(const char *fmt, ...)
-#else
-shellf(fmt, va_alist)
-	const char *fmt;
-	va_dcl
-#endif
 {
 	va_list va;
 
@@ -168,13 +136,7 @@ shellf(fmt, va_alist)
 
 /* printf to shl_stdout (stdout) */
 void
-#ifdef HAVE_PROTOTYPES
 shprintf(const char *fmt, ...)
-#else
-shprintf(fmt, va_alist)
-	const char *fmt;
-	va_dcl
-#endif
 {
 	va_list va;
 
@@ -204,13 +166,7 @@ kshdebug_init_()
 
 /* print to debugging log */
 void
-# ifdef HAVE_PROTOTYPES
 kshdebug_printf_(const char *fmt, ...)
-# else
-kshdebug_printf_(fmt, va_alist)
-	const char *fmt;
-	va_dcl
-# endif
 {
 	va_list va;
 

Index: src/bin/ksh/lex.c
diff -u src/bin/ksh/lex.c:1.19 src/bin/ksh/lex.c:1.20
--- src/bin/ksh/lex.c:1.19	Fri Jun 23 00:18:01 2017
+++ src/bin/ksh/lex.c	Fri Jun 30 02:51:14 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: lex.c,v 1.19 2017/06/23 00:18:01 kamil Exp $	*/
+/*	$NetBSD: lex.c,v 1.20 2017/06/30 02:51:14 kamil Exp $	*/
 
 /*
  * lexical analysis and source input
@@ -6,7 +6,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: lex.c,v 1.19 2017/06/23 00:18:01 kamil Exp $");
+__RCSID("$NetBSD: lex.c,v 1.20 2017/06/30 02:51:14 kamil Exp $");
 #endif
 
 
@@ -836,13 +836,7 @@ readhere(iop)
 }
 
 void
-#ifdef HAVE_PROTOTYPES
 yyerror(const char *fmt, ...)
-#else
-yyerror(fmt, va_alist)
-	const char *fmt;
-	va_dcl
-#endif
 {
 	va_list va;
 

Index: src/bin/ksh/sh.h
diff -u src/bin/ksh/sh.h:1.30 src/bin/ksh/sh.h:1.31
--- src/bin/ksh/sh.h:1.30	Fri Jun 30 02:38:10 2017
+++ src/bin/ksh/sh.h	Fri Jun 30 02:51:14 2017
@@ -1,18 +1,14 @@
-/*	$NetBSD: sh.h,v 1.30 2017/06/30 02:38:10 kamil Exp $	*/
+/*	$NetBSD: sh.h,v 1.31 2017/06/30 02:51:14 kamil Exp $	*/
 
 /*
  * Public Domain Bourne/Korn shell
  */
 
-/* $Id: sh.h,v 1.30 2017/06/30 02:38:10 kamil Exp $ */
+/* $Id: sh.h,v 1.31 2017/06/30 02:51:14 kamil Exp $ */
 
 #include "config.h"	/* 

CVS commit: src/bin/ksh

2017-06-29 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 30 02:38:10 UTC 2017

Modified Files:
src/bin/ksh: conf-end.h config.h exec.c jobs.c sh.h

Log Message:
ksh: Drop support for systems without functional waitpid(2)


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/bin/ksh/conf-end.h
cvs rdiff -u -r1.44 -r1.45 src/bin/ksh/config.h
cvs rdiff -u -r1.20 -r1.21 src/bin/ksh/exec.c
cvs rdiff -u -r1.15 -r1.16 src/bin/ksh/jobs.c
cvs rdiff -u -r1.29 -r1.30 src/bin/ksh/sh.h

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



CVS commit: src/bin/ksh

2017-06-29 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 30 02:38:10 UTC 2017

Modified Files:
src/bin/ksh: conf-end.h config.h exec.c jobs.c sh.h

Log Message:
ksh: Drop support for systems without functional waitpid(2)


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/bin/ksh/conf-end.h
cvs rdiff -u -r1.44 -r1.45 src/bin/ksh/config.h
cvs rdiff -u -r1.20 -r1.21 src/bin/ksh/exec.c
cvs rdiff -u -r1.15 -r1.16 src/bin/ksh/jobs.c
cvs rdiff -u -r1.29 -r1.30 src/bin/ksh/sh.h

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

Modified files:

Index: src/bin/ksh/conf-end.h
diff -u src/bin/ksh/conf-end.h:1.6 src/bin/ksh/conf-end.h:1.7
--- src/bin/ksh/conf-end.h:1.6	Fri Jun 30 02:20:47 2017
+++ src/bin/ksh/conf-end.h	Fri Jun 30 02:38:09 2017
@@ -1,9 +1,9 @@
-/*	$NetBSD: conf-end.h,v 1.6 2017/06/30 02:20:47 kamil Exp $	*/
+/*	$NetBSD: conf-end.h,v 1.7 2017/06/30 02:38:09 kamil Exp $	*/
 
 /*
  * End of configuration stuff for PD ksh.
  *
- * RCSid: $NetBSD: conf-end.h,v 1.6 2017/06/30 02:20:47 kamil Exp $
+ * RCSid: $NetBSD: conf-end.h,v 1.7 2017/06/30 02:38:09 kamil Exp $
  */
 
 #if defined(EMACS) || defined(VI)
@@ -22,15 +22,6 @@
 # define EASY_HISTORY			/* sjg's trivial history file */
 #endif
 
-/* Can we safely catch sigchld and wait for processes? */
-#if defined(HAVE_WAITPID) || defined(HAVE_WAIT3)
-# define JOB_SIGS
-#endif
-
-#if !defined(JOB_SIGS) || !(defined(POSIX_PGRP) || defined(BSD_PGRP))
-# undef JOBS /* if no JOB_SIGS, no job control support */
-#endif
-
 #ifdef HAVE_GCC_FUNC_ATTR
 # define GCC_FUNC_ATTR(x)	__attribute__((x))
 # define GCC_FUNC_ATTR2(x,y)	__attribute__((x,y))

Index: src/bin/ksh/config.h
diff -u src/bin/ksh/config.h:1.44 src/bin/ksh/config.h:1.45
--- src/bin/ksh/config.h:1.44	Fri Jun 30 02:20:47 2017
+++ src/bin/ksh/config.h	Fri Jun 30 02:38:09 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: config.h,v 1.44 2017/06/30 02:20:47 kamil Exp $	*/
+/*	$NetBSD: config.h,v 1.45 2017/06/30 02:38:09 kamil Exp $	*/
 
 /* config.h.  Generated automatically by configure.  */
 /* config.h.in.  Generated automatically from configure.in by autoheader.  */
@@ -187,12 +187,6 @@
 /* Define if you have the valloc function.  */
 #define HAVE_VALLOC 1
 
-/* Define if you have the wait3 function.  */
-#define HAVE_WAIT3 1
-
-/* Define if you have the waitpid function.  */
-#define HAVE_WAITPID 1
-
 /* Define if you have the  header file.  */
 #define HAVE_DIRENT_H 1
 

Index: src/bin/ksh/exec.c
diff -u src/bin/ksh/exec.c:1.20 src/bin/ksh/exec.c:1.21
--- src/bin/ksh/exec.c:1.20	Fri Jun 30 02:06:59 2017
+++ src/bin/ksh/exec.c	Fri Jun 30 02:38:10 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: exec.c,v 1.20 2017/06/30 02:06:59 kamil Exp $	*/
+/*	$NetBSD: exec.c,v 1.21 2017/06/30 02:38:10 kamil Exp $	*/
 
 /*
  * execute command tree
@@ -6,7 +6,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: exec.c,v 1.20 2017/06/30 02:06:59 kamil Exp $");
+__RCSID("$NetBSD: exec.c,v 1.21 2017/06/30 02:38:10 kamil Exp $");
 #endif
 
 
@@ -201,11 +201,8 @@ execute(t, flags)
 #ifdef KSH
 	  case TCOPROC:
 	  {
-# ifdef JOB_SIGS
 		sigset_t	omask;
-# endif /* JOB_SIGS */
 
-# ifdef JOB_SIGS
 		/* Block sigchild as we are using things changed in the
 		 * signal handler
 		 */
@@ -218,7 +215,7 @@ execute(t, flags)
 			unwind(i);
 			/*NOTREACHED*/
 		}
-# endif /* JOB_SIGS */
+
 		/* Already have a (live) co-process? */
 		if (coproc.job && coproc.write >= 0)
 			errorf("coprocess already exists");
@@ -249,10 +246,9 @@ execute(t, flags)
 			/* create new coprocess id */
 			++coproc.id;
 		}
-# ifdef JOB_SIGS
+
 		sigprocmask(SIG_SETMASK, , (sigset_t *) 0);
 		e->type = E_EXEC; /* no more need for error handler */
-# endif /* JOB_SIGS */
 
 		/* exchild() closes coproc.* in child after fork,
 		 * will also increment coproc.njobs when the

Index: src/bin/ksh/jobs.c
diff -u src/bin/ksh/jobs.c:1.15 src/bin/ksh/jobs.c:1.16
--- src/bin/ksh/jobs.c:1.15	Fri Jun 30 01:52:34 2017
+++ src/bin/ksh/jobs.c	Fri Jun 30 02:38:10 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: jobs.c,v 1.15 2017/06/30 01:52:34 kamil Exp $	*/
+/*	$NetBSD: jobs.c,v 1.16 2017/06/30 02:38:10 kamil Exp $	*/
 
 /*
  * Process and job control
@@ -14,11 +14,6 @@
  * work :)
  *
  * Notes regarding the copious ifdefs:
- *	- JOB_SIGS is independent of JOBS - it is defined if there are modern
- *	  signal and wait routines available.  This is preferred, even when
- *	  JOBS is not defined, since the shell will not otherwise notice when
- *	  background jobs die until the shell waits for a foreground process
- *	  to die.
  *	- TTY_PGRP defined iff JOBS is defined - defined if there are tty
  *	  process groups
  *	- NEED_PGRP_SYNC defined iff JOBS is defined - see comment below
@@ -26,7 +21,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: jobs.c,v 1.15 2017/06/30 01:52:34 kamil Exp $");
+__RCSID("$NetBSD: jobs.c,v 1.16 2017/06/30 02:38:10 kamil Exp $");
 #endif
 
 #include 
@@ -187,10 +182,8 @@ static int_least32_t	

CVS commit: src/bin/ksh

2017-06-29 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 30 02:20:47 UTC 2017

Modified Files:
src/bin/ksh: conf-end.h config.h

Log Message:
ksh: Drop support for systems without POSIX signal routines


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/bin/ksh/conf-end.h
cvs rdiff -u -r1.43 -r1.44 src/bin/ksh/config.h

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



CVS commit: src/bin/ksh

2017-06-29 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 30 02:20:47 UTC 2017

Modified Files:
src/bin/ksh: conf-end.h config.h

Log Message:
ksh: Drop support for systems without POSIX signal routines


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/bin/ksh/conf-end.h
cvs rdiff -u -r1.43 -r1.44 src/bin/ksh/config.h

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

Modified files:

Index: src/bin/ksh/conf-end.h
diff -u src/bin/ksh/conf-end.h:1.5 src/bin/ksh/conf-end.h:1.6
--- src/bin/ksh/conf-end.h:1.5	Fri Jun 30 02:13:29 2017
+++ src/bin/ksh/conf-end.h	Fri Jun 30 02:20:47 2017
@@ -1,9 +1,9 @@
-/*	$NetBSD: conf-end.h,v 1.5 2017/06/30 02:13:29 kamil Exp $	*/
+/*	$NetBSD: conf-end.h,v 1.6 2017/06/30 02:20:47 kamil Exp $	*/
 
 /*
  * End of configuration stuff for PD ksh.
  *
- * RCSid: $NetBSD: conf-end.h,v 1.5 2017/06/30 02:13:29 kamil Exp $
+ * RCSid: $NetBSD: conf-end.h,v 1.6 2017/06/30 02:20:47 kamil Exp $
  */
 
 #if defined(EMACS) || defined(VI)
@@ -23,8 +23,7 @@
 #endif
 
 /* Can we safely catch sigchld and wait for processes? */
-#if (defined(HAVE_WAITPID) || defined(HAVE_WAIT3)) \
-&& (defined(POSIX_SIGNALS))
+#if defined(HAVE_WAITPID) || defined(HAVE_WAIT3)
 # define JOB_SIGS
 #endif
 

Index: src/bin/ksh/config.h
diff -u src/bin/ksh/config.h:1.43 src/bin/ksh/config.h:1.44
--- src/bin/ksh/config.h:1.43	Fri Jun 30 02:13:29 2017
+++ src/bin/ksh/config.h	Fri Jun 30 02:20:47 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: config.h,v 1.43 2017/06/30 02:13:29 kamil Exp $	*/
+/*	$NetBSD: config.h,v 1.44 2017/06/30 02:20:47 kamil Exp $	*/
 
 /* config.h.  Generated automatically by configure.  */
 /* config.h.in.  Generated automatically from configure.in by autoheader.  */
@@ -39,9 +39,6 @@
 /* Define as the return value of signal handlers (0 or ).  */
 #define RETSIGVAL 
 
-/* Define if you have posix signal routines (sigaction(), et. al.) */
-#define POSIX_SIGNALS 1
-
 /* Define to use the fake posix signal routines (sigact.[ch]) */
 /* #undef USE_FAKE_SIGACT */
 



CVS commit: src/bin/ksh

2017-06-29 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 30 02:13:29 UTC 2017

Modified Files:
src/bin/ksh: conf-end.h config.h

Log Message:
ksh: Drop support for systems without implementation of EINTR

These systems weren't handled anyway.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/bin/ksh/conf-end.h
cvs rdiff -u -r1.42 -r1.43 src/bin/ksh/config.h

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

Modified files:

Index: src/bin/ksh/conf-end.h
diff -u src/bin/ksh/conf-end.h:1.4 src/bin/ksh/conf-end.h:1.5
--- src/bin/ksh/conf-end.h:1.4	Thu Jun 22 23:59:28 2017
+++ src/bin/ksh/conf-end.h	Fri Jun 30 02:13:29 2017
@@ -1,9 +1,9 @@
-/*	$NetBSD: conf-end.h,v 1.4 2017/06/22 23:59:28 kamil Exp $	*/
+/*	$NetBSD: conf-end.h,v 1.5 2017/06/30 02:13:29 kamil Exp $	*/
 
 /*
  * End of configuration stuff for PD ksh.
  *
- * RCSid: $NetBSD: conf-end.h,v 1.4 2017/06/22 23:59:28 kamil Exp $
+ * RCSid: $NetBSD: conf-end.h,v 1.5 2017/06/30 02:13:29 kamil Exp $
  */
 
 #if defined(EMACS) || defined(VI)
@@ -32,18 +32,6 @@
 # undef JOBS /* if no JOB_SIGS, no job control support */
 #endif
 
-/* pdksh assumes system calls return EINTR if a signal happened (this so
- * the signal handler doesn't have to longjmp()).  I don't know if this
- * happens (or can be made to happen) with sigset() et. al. (the bsd41 signal
- * routines), so, the autoconf stuff checks what they do and defines
- * SIGNALS_DONT_INTERRUPT if signals don't interrupt read().
- * If SIGNALS_DONT_INTERRUPT isn't defined and your compiler chokes on this,
- * delete the hash in front of the error (and file a bug report).
- */
-#ifdef SIGNALS_DONT_INTERRUPT
-  # error pdksh needs interruptable system calls.
-#endif /* SIGNALS_DONT_INTERRUPT */
-
 #ifdef HAVE_GCC_FUNC_ATTR
 # define GCC_FUNC_ATTR(x)	__attribute__((x))
 # define GCC_FUNC_ATTR2(x,y)	__attribute__((x,y))

Index: src/bin/ksh/config.h
diff -u src/bin/ksh/config.h:1.42 src/bin/ksh/config.h:1.43
--- src/bin/ksh/config.h:1.42	Fri Jun 30 02:06:59 2017
+++ src/bin/ksh/config.h	Fri Jun 30 02:13:29 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: config.h,v 1.42 2017/06/30 02:06:59 kamil Exp $	*/
+/*	$NetBSD: config.h,v 1.43 2017/06/30 02:13:29 kamil Exp $	*/
 
 /* config.h.  Generated automatically by configure.  */
 /* config.h.in.  Generated automatically from configure.in by autoheader.  */
@@ -45,9 +45,6 @@
 /* Define to use the fake posix signal routines (sigact.[ch]) */
 /* #undef USE_FAKE_SIGACT */
 
-/* Define if signals don't interrupt read() */
-/* #undef SIGNALS_DONT_INTERRUPT */
-
 /* Define if you have bsd versions of the setpgrp() and getpgrp() routines */
 /* #undef BSD_PGRP */
 



CVS commit: src/bin/ksh

2017-06-29 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 30 02:13:29 UTC 2017

Modified Files:
src/bin/ksh: conf-end.h config.h

Log Message:
ksh: Drop support for systems without implementation of EINTR

These systems weren't handled anyway.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/bin/ksh/conf-end.h
cvs rdiff -u -r1.42 -r1.43 src/bin/ksh/config.h

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



CVS commit: src/bin/ksh

2017-06-29 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 30 02:06:59 UTC 2017

Modified Files:
src/bin/ksh: config.h eval.c exec.c

Log Message:
ksh: Drop support for systems without handling shebang


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/bin/ksh/config.h
cvs rdiff -u -r1.19 -r1.20 src/bin/ksh/eval.c src/bin/ksh/exec.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/ksh/config.h
diff -u src/bin/ksh/config.h:1.41 src/bin/ksh/config.h:1.42
--- src/bin/ksh/config.h:1.41	Fri Jun 30 02:02:41 2017
+++ src/bin/ksh/config.h	Fri Jun 30 02:06:59 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: config.h,v 1.41 2017/06/30 02:02:41 kamil Exp $	*/
+/*	$NetBSD: config.h,v 1.42 2017/06/30 02:06:59 kamil Exp $	*/
 
 /* config.h.  Generated automatically by configure.  */
 /* config.h.in.  Generated automatically from configure.in by autoheader.  */
@@ -36,9 +36,6 @@
 /* Define if you can safely include both  and .  */
 #define TIME_WITH_SYS_TIME 1
 
-/* Define if your kernel doesn't handle scripts starting with #! */
-/* #undef SHARPBANG */
-
 /* Define as the return value of signal handlers (0 or ).  */
 #define RETSIGVAL 
 

Index: src/bin/ksh/eval.c
diff -u src/bin/ksh/eval.c:1.19 src/bin/ksh/eval.c:1.20
--- src/bin/ksh/eval.c:1.19	Thu Jun 22 14:20:46 2017
+++ src/bin/ksh/eval.c	Fri Jun 30 02:06:59 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: eval.c,v 1.19 2017/06/22 14:20:46 kamil Exp $	*/
+/*	$NetBSD: eval.c,v 1.20 2017/06/30 02:06:59 kamil Exp $	*/
 
 /*
  * Expansion - quoting, separation, substitution, globbing
@@ -6,7 +6,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: eval.c,v 1.19 2017/06/22 14:20:46 kamil Exp $");
+__RCSID("$NetBSD: eval.c,v 1.20 2017/06/30 02:06:59 kamil Exp $");
 #endif
 
 #include 
@@ -95,17 +95,10 @@ eval(ap, f)
 		return ap;
 	XPinit(w, 32);
 	XPput(w, NULL);		/* space for shell name */
-#ifdef	SHARPBANG
-	XPput(w, NULL);		/* and space for one arg */
-#endif
 	while (*ap != NULL)
 		expand(*ap++, , f);
 	XPput(w, NULL);
-#ifdef	SHARPBANG
-	return (char **) XPclose(w) + 2;
-#else
 	return (char **) XPclose(w) + 1;
-#endif
 }
 
 /*
Index: src/bin/ksh/exec.c
diff -u src/bin/ksh/exec.c:1.19 src/bin/ksh/exec.c:1.20
--- src/bin/ksh/exec.c:1.19	Thu Jun 22 23:47:29 2017
+++ src/bin/ksh/exec.c	Fri Jun 30 02:06:59 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: exec.c,v 1.19 2017/06/22 23:47:29 kamil Exp $	*/
+/*	$NetBSD: exec.c,v 1.20 2017/06/30 02:06:59 kamil Exp $	*/
 
 /*
  * execute command tree
@@ -6,7 +6,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: exec.c,v 1.19 2017/06/22 23:47:29 kamil Exp $");
+__RCSID("$NetBSD: exec.c,v 1.20 2017/06/30 02:06:59 kamil Exp $");
 #endif
 
 
@@ -764,53 +764,6 @@ scriptexec(tp, ap)
 		shellv = __UNCONST(EXECSHELL);
 
 	*tp->args-- = tp->str;
-#ifdef	SHARPBANG
-	{
-		char buf[LINE];
-		register char *cp;
-		register int fd, n;
-
-		buf[0] = '\0';
-		if ((fd = open(tp->str, O_RDONLY)) >= 0) {
-			if ((n = read(fd, buf, LINE - 1)) > 0)
-buf[n] = '\0';
-			(void) close(fd);
-		}
-		if ((buf[0] == '#' && buf[1] == '!' && (cp = [2]))
-		)
-		{
-			while (*cp && (*cp == ' ' || *cp == '\t'))
-cp++;
-			if (*cp && *cp != '\n') {
-char *a0 = cp, *a1 = (char *) 0;
-
-while (*cp && *cp != '\n' && *cp != ' '
-   && *cp != '\t')
-{
-	cp++;
-}
-if (*cp && *cp != '\n') {
-	*cp++ = '\0';
-	while (*cp
-	   && (*cp == ' ' || *cp == '\t'))
-		cp++;
-	if (*cp && *cp != '\n') {
-		a1 = cp;
-		/* all one argument */
-		while (*cp && *cp != '\n')
-			cp++;
-	}
-}
-if (*cp == '\n') {
-	*cp = '\0';
-	if (a1)
-		*tp->args-- = a1;
-	shellv = a0;
-}
-			}
-		}
-	}
-#endif	/* SHARPBANG */
 	*tp->args = shellv;
 
 	execve(tp->args[0], tp->args, ap);



CVS commit: src/bin/ksh

2017-06-29 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 30 02:06:59 UTC 2017

Modified Files:
src/bin/ksh: config.h eval.c exec.c

Log Message:
ksh: Drop support for systems without handling shebang


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/bin/ksh/config.h
cvs rdiff -u -r1.19 -r1.20 src/bin/ksh/eval.c src/bin/ksh/exec.c

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



CVS commit: src/bin/ksh

2017-06-29 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 30 02:02:41 UTC 2017

Modified Files:
src/bin/ksh: config.h

Log Message:
ksh: Drop support for OSes without POSIX types

Assume available: mode_t, off_t, pid_t, uid_t, rlim_t, sigset_t.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/bin/ksh/config.h

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



CVS commit: src/bin/ksh

2017-06-29 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 30 02:02:41 UTC 2017

Modified Files:
src/bin/ksh: config.h

Log Message:
ksh: Drop support for OSes without POSIX types

Assume available: mode_t, off_t, pid_t, uid_t, rlim_t, sigset_t.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/bin/ksh/config.h

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

Modified files:

Index: src/bin/ksh/config.h
diff -u src/bin/ksh/config.h:1.40 src/bin/ksh/config.h:1.41
--- src/bin/ksh/config.h:1.40	Fri Jun 30 01:56:34 2017
+++ src/bin/ksh/config.h	Fri Jun 30 02:02:41 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: config.h,v 1.40 2017/06/30 01:56:34 kamil Exp $	*/
+/*	$NetBSD: config.h,v 1.41 2017/06/30 02:02:41 kamil Exp $	*/
 
 /* config.h.  Generated automatically by configure.  */
 /* config.h.in.  Generated automatically from configure.in by autoheader.  */
@@ -17,15 +17,6 @@
 /* Define if on MINIX.  */
 /* #undef _MINIX */
 
-/* Define to `int' if  doesn't define.  */
-/* #undef mode_t */
-
-/* Define to `long' if  doesn't define.  */
-/* #undef off_t */
-
-/* Define to `int' if  doesn't define.  */
-/* #undef pid_t */
-
 /* Define if the system does not provide POSIX.1 features except
with this defined.  */
 /* #undef _POSIX_1_SOURCE */
@@ -45,9 +36,6 @@
 /* Define if you can safely include both  and .  */
 #define TIME_WITH_SYS_TIME 1
 
-/* Define to `int' if  doesn't define.  */
-/* #undef uid_t */
-
 /* Define if your kernel doesn't handle scripts starting with #! */
 /* #undef SHARPBANG */
 
@@ -81,15 +69,9 @@
 /* Define if C compiler groks __attribute__((...)) (const, noreturn, format) */
 #define HAVE_GCC_FUNC_ATTR 1
 
-/* Define to the type of struct rlimit fields if the rlim_t type is missing */
-/* #undef rlim_t */
-
 /* Define if time() is declared in  */
 #define TIME_DECLARED 1
 
-/* Define to `unsigned' if  doesn't define */
-/* #undef sigset_t */
-
 /* Define if sys_errlist[] and sys_nerr are in the C library */
 #define HAVE_SYS_ERRLIST 1
 



CVS commit: src/bin/ksh

2017-06-29 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 30 01:56:34 UTC 2017

Modified Files:
src/bin/ksh: config.h

Log Message:
ksh: Drop support for systems without 


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/bin/ksh/config.h

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

Modified files:

Index: src/bin/ksh/config.h
diff -u src/bin/ksh/config.h:1.39 src/bin/ksh/config.h:1.40
--- src/bin/ksh/config.h:1.39	Fri Jun 30 01:36:30 2017
+++ src/bin/ksh/config.h	Fri Jun 30 01:56:34 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: config.h,v 1.39 2017/06/30 01:36:30 kamil Exp $	*/
+/*	$NetBSD: config.h,v 1.40 2017/06/30 01:56:34 kamil Exp $	*/
 
 /* config.h.  Generated automatically by configure.  */
 /* config.h.in.  Generated automatically from configure.in by autoheader.  */
@@ -14,9 +14,6 @@
 /* Define if your struct stat has st_rdev.  */
 #define HAVE_ST_RDEV 1
 
-/* Define if you have  that is POSIX.1 compatible.  */
-#define HAVE_SYS_WAIT_H 1
-
 /* Define if on MINIX.  */
 /* #undef _MINIX */
 
@@ -247,9 +244,6 @@
 /* Define if you have the  header file.  */
 #define HAVE_SYS_TIME_H 1
 
-/* Define if you have the  header file.  */
-#define HAVE_SYS_WAIT_H 1
-
 /* Define if you have the  header file.  */
 #define HAVE_ULIMIT_H
 



CVS commit: src/bin/ksh

2017-06-29 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 30 01:56:34 UTC 2017

Modified Files:
src/bin/ksh: config.h

Log Message:
ksh: Drop support for systems without 


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/bin/ksh/config.h

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



CVS commit: src/bin/ksh

2017-06-29 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 30 01:52:34 UTC 2017

Modified Files:
src/bin/ksh: jobs.c
Removed Files:
src/bin/ksh: ksh_wait.h

Log Message:
ksh: Drop ksh_wait.h that reinvents  (POSIX header)

Switch jobs.c to .

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/bin/ksh/jobs.c
cvs rdiff -u -r1.2 -r0 src/bin/ksh/ksh_wait.h

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



CVS commit: src/bin/ksh

2017-06-29 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 30 01:52:34 UTC 2017

Modified Files:
src/bin/ksh: jobs.c
Removed Files:
src/bin/ksh: ksh_wait.h

Log Message:
ksh: Drop ksh_wait.h that reinvents  (POSIX header)

Switch jobs.c to .

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/bin/ksh/jobs.c
cvs rdiff -u -r1.2 -r0 src/bin/ksh/ksh_wait.h

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

Modified files:

Index: src/bin/ksh/jobs.c
diff -u src/bin/ksh/jobs.c:1.14 src/bin/ksh/jobs.c:1.15
--- src/bin/ksh/jobs.c:1.14	Fri Jun 23 00:29:42 2017
+++ src/bin/ksh/jobs.c	Fri Jun 30 01:52:34 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: jobs.c,v 1.14 2017/06/23 00:29:42 kamil Exp $	*/
+/*	$NetBSD: jobs.c,v 1.15 2017/06/30 01:52:34 kamil Exp $	*/
 
 /*
  * Process and job control
@@ -26,13 +26,13 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: jobs.c,v 1.14 2017/06/23 00:29:42 kamil Exp $");
+__RCSID("$NetBSD: jobs.c,v 1.15 2017/06/30 01:52:34 kamil Exp $");
 #endif
 
+#include 
 
 #include "sh.h"
 #include "ksh_stat.h"
-#include "ksh_wait.h"
 #include "ksh_times.h"
 #include "tty.h"
 
@@ -103,7 +103,7 @@ typedef struct proc	Proc;
 struct proc {
 	Proc	*next;		/* next process in pipeline (if any) */
 	int	state;
-	WAIT_T	status;		/* wait status */
+	int	status;		/* wait status */
 	pid_t	pid;		/* process id */
 	char	command[48];	/* process command string */
 };
@@ -469,7 +469,7 @@ exchild(t, flags, close_fd)
 	p = new_proc();
 	p->next = (Proc *) 0;
 	p->state = PRUNNING;
-	WSTATUS(p->status) = 0;
+	p->status = 0;
 	p->pid = 0;
 
 	/* link process into jobs list */
@@ -891,7 +891,7 @@ j_resume(cp, bg)
 	for (p = j->proc_list; p != (Proc *) 0; p = p->next) {
 		if (p->state == PSTOPPED) {
 			p->state = PRUNNING;
-			WSTATUS(p->status) = 0;
+			p->status = 0;
 			running = 1;
 		}
 		shprintf("%s%s", p->command, p->next ? "| " : null);
@@ -1212,7 +1212,7 @@ j_waitj(j, flags, where)
 	j->flags &= ~(JF_WAITING|JF_W_ASYNCNOTIFY);
 
 	if (j->flags & JF_FG) {
-		WAIT_T	status;
+		int	status;
 
 		j->flags &= ~JF_FG;
 #ifdef TTY_PGRP
@@ -1317,7 +1317,7 @@ j_sigchld(sig)
 	Job		*j;
 	Proc		UNINITIALIZED(*p);
 	int		pid;
-	WAIT_T		status;
+	int		status;
 	struct tms	t0, t1;
 
 #ifdef JOB_SIGS
@@ -1336,7 +1336,7 @@ j_sigchld(sig)
 	ksh_times();
 	do {
 #ifdef JOB_SIGS
-		pid = ksh_waitpid(-1, , (WNOHANG|WUNTRACED));
+		pid = waitpid(-1, , (WNOHANG|WUNTRACED));
 #else /* JOB_SIGS */
 		pid = wait();
 #endif /* JOB_SIGS */
@@ -1513,7 +1513,7 @@ j_print(j, how, shf)
 {
 	Proc	*p;
 	int	state;
-	WAIT_T	status;
+	int	status;
 	int	coredumped;
 	char	jobchar = ' ';
 	char	buf[64];
@@ -1556,7 +1556,7 @@ j_print(j, how, shf)
 	WEXITSTATUS(p->status));
 			break;
 		case PSIGNALLED:
-			if (WIFCORED(p->status))
+			if (WCOREDUMP(p->status))
 coredumped = 1;
 			/* kludge for not reporting `normal termination signals'
 			 * (ie, SIGINT, SIGPIPE)
@@ -1597,8 +1597,7 @@ j_print(j, how, shf)
 		state = p->state;
 		status = p->status;
 		p = p->next;
-		while (p && p->state == state
-		   && WSTATUS(p->status) == WSTATUS(status))
+		while (p && p->state == state && p->status == status)
 		{
 			if (how == JP_LONG)
 shf_fprintf(shf, "%s%5d %-20s %s%s", filler, p->pid,



CVS commit: src/bin/ksh

2017-06-29 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 30 01:36:30 UTC 2017

Modified Files:
src/bin/ksh: config.h

Log Message:
ksh: Drop support for systems without gid_t


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/bin/ksh/config.h

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

Modified files:

Index: src/bin/ksh/config.h
diff -u src/bin/ksh/config.h:1.38 src/bin/ksh/config.h:1.39
--- src/bin/ksh/config.h:1.38	Fri Jun 23 00:35:20 2017
+++ src/bin/ksh/config.h	Fri Jun 30 01:36:30 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: config.h,v 1.38 2017/06/23 00:35:20 kamil Exp $	*/
+/*	$NetBSD: config.h,v 1.39 2017/06/30 01:36:30 kamil Exp $	*/
 
 /* config.h.  Generated automatically by configure.  */
 /* config.h.in.  Generated automatically from configure.in by autoheader.  */
@@ -11,9 +11,6 @@
 #ifndef CONFIG_H
 #define CONFIG_H
 
-/* Define to `int' if  doesn't define.  */
-/* #undef gid_t */
-
 /* Define if your struct stat has st_rdev.  */
 #define HAVE_ST_RDEV 1
 



CVS commit: src/bin/ksh

2017-06-29 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 30 01:36:30 UTC 2017

Modified Files:
src/bin/ksh: config.h

Log Message:
ksh: Drop support for systems without gid_t


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/bin/ksh/config.h

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



Re: CVS commit: src/bin/ksh

2017-06-22 Thread Kamil Rytarowski
On 23.06.2017 02:12, matthew green wrote:
> "Kamil Rytarowski" writes:
>> Module Name: src
>> Committed By:kamil
>> Date:Thu Jun 22 13:32:04 UTC 2017
>>
>> Modified Files:
>>  src/bin/ksh: c_ksh.c edit.c path.c sh.h
>>
>> Log Message:
>> Remove ancient cygwin support in ksh(1)
>>
>> OK by 
> 
> i thought ksh was upstream owned code, so changes like this
> seem to be out of place in netbsd tree.
> 
> why are you doing all this?
> 
> 
> .mrg
> 

I haven't found active upstream development since around 1999; I have
local patches and I took maintainership. This is what happened in other
BSDs.

I got some old patches and I will try to upstream them after removing
K code. This will also help to address some local bugs that affect my
shell usage.

The domain for multiplatform legacy Unices is covered by MKSH (developed
against gcc1, gcc2). So no need to compete with them for this niche.



signature.asc
Description: OpenPGP digital signature


CVS commit: src/bin/ksh

2017-06-22 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 23 00:35:20 UTC 2017

Modified Files:
src/bin/ksh: config.h

Log Message:
ksh: Drop support for systems without clock_t type


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/bin/ksh/config.h

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



CVS commit: src/bin/ksh

2017-06-22 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 23 00:35:20 UTC 2017

Modified Files:
src/bin/ksh: config.h

Log Message:
ksh: Drop support for systems without clock_t type


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/bin/ksh/config.h

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

Modified files:

Index: src/bin/ksh/config.h
diff -u src/bin/ksh/config.h:1.37 src/bin/ksh/config.h:1.38
--- src/bin/ksh/config.h:1.37	Fri Jun 23 00:29:42 2017
+++ src/bin/ksh/config.h	Fri Jun 23 00:35:20 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: config.h,v 1.37 2017/06/23 00:29:42 kamil Exp $	*/
+/*	$NetBSD: config.h,v 1.38 2017/06/23 00:35:20 kamil Exp $	*/
 
 /* config.h.  Generated automatically by configure.  */
 /* config.h.in.  Generated automatically from configure.in by autoheader.  */
@@ -87,9 +87,6 @@
 /* Define if C compiler groks __attribute__((...)) (const, noreturn, format) */
 #define HAVE_GCC_FUNC_ATTR 1
 
-/* Define to 32-bit signed integer type if  doesn't define */
-/* #undef clock_t */
-
 /* Define to the type of struct rlimit fields if the rlim_t type is missing */
 /* #undef rlim_t */
 



CVS commit: src/bin/ksh

2017-06-22 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 23 00:29:42 UTC 2017

Modified Files:
src/bin/ksh: config.h jobs.c sh.h

Log Message:
ksh: Replace homegrown int_least32_t with the C99 version


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/bin/ksh/config.h
cvs rdiff -u -r1.13 -r1.14 src/bin/ksh/jobs.c
cvs rdiff -u -r1.28 -r1.29 src/bin/ksh/sh.h

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

Modified files:

Index: src/bin/ksh/config.h
diff -u src/bin/ksh/config.h:1.36 src/bin/ksh/config.h:1.37
--- src/bin/ksh/config.h:1.36	Fri Jun 23 00:20:22 2017
+++ src/bin/ksh/config.h	Fri Jun 23 00:29:42 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: config.h,v 1.36 2017/06/23 00:20:22 kamil Exp $	*/
+/*	$NetBSD: config.h,v 1.37 2017/06/23 00:29:42 kamil Exp $	*/
 
 /* config.h.  Generated automatically by configure.  */
 /* config.h.in.  Generated automatically from configure.in by autoheader.  */
@@ -172,12 +172,6 @@
 /* Include game-of-life? */
 /* #undef SILLY */
 
-/* The number of bytes in a int.  */
-#define SIZEOF_INT 4
-
-/* The number of bytes in a long.  */
-#define SIZEOF_LONG 4
-
 /* Define if you have the _setjmp function.  */
 #define HAVE__SETJMP
 

Index: src/bin/ksh/jobs.c
diff -u src/bin/ksh/jobs.c:1.13 src/bin/ksh/jobs.c:1.14
--- src/bin/ksh/jobs.c:1.13	Thu Jun 22 14:20:46 2017
+++ src/bin/ksh/jobs.c	Fri Jun 23 00:29:42 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: jobs.c,v 1.13 2017/06/22 14:20:46 kamil Exp $	*/
+/*	$NetBSD: jobs.c,v 1.14 2017/06/23 00:29:42 kamil Exp $	*/
 
 /*
  * Process and job control
@@ -26,7 +26,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: jobs.c,v 1.13 2017/06/22 14:20:46 kamil Exp $");
+__RCSID("$NetBSD: jobs.c,v 1.14 2017/06/23 00:29:42 kamil Exp $");
 #endif
 
 
@@ -142,7 +142,7 @@ struct job {
 	int	status;		/* exit status of last process */
 	pid_t	pgrp;		/* process group of job */
 	pid_t	ppid;		/* pid of process that forked job */
-	INT32	age;		/* number of jobs started */
+	int_least32_t	age;	/* number of jobs started */
 	clock_t	systime;	/* system time used by job */
 	clock_t	usrtime;	/* user time used by job */
 	Proc	*proc_list;	/* process list */
@@ -183,7 +183,7 @@ static Job		*async_job;
 static pid_t		async_pid;
 
 static int		nzombie;	/* # of zombies owned by this process */
-static INT32		njobs;		/* # of jobs started */
+static int_least32_t	njobs;		/* # of jobs started */
 static int		child_max;	/* CHILD_MAX */
 
 

Index: src/bin/ksh/sh.h
diff -u src/bin/ksh/sh.h:1.28 src/bin/ksh/sh.h:1.29
--- src/bin/ksh/sh.h:1.28	Fri Jun 23 00:18:01 2017
+++ src/bin/ksh/sh.h	Fri Jun 23 00:29:42 2017
@@ -1,10 +1,10 @@
-/*	$NetBSD: sh.h,v 1.28 2017/06/23 00:18:01 kamil Exp $	*/
+/*	$NetBSD: sh.h,v 1.29 2017/06/23 00:29:42 kamil Exp $	*/
 
 /*
  * Public Domain Bourne/Korn shell
  */
 
-/* $Id: sh.h,v 1.28 2017/06/23 00:18:01 kamil Exp $ */
+/* $Id: sh.h,v 1.29 2017/06/23 00:29:42 kamil Exp $ */
 
 #include "config.h"	/* system and option configuration info */
 
@@ -26,6 +26,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #ifndef O_ACCMODE
 # define O_ACCMODE	(O_RDONLY|O_WRONLY|O_RDWR)
@@ -118,20 +119,6 @@ typedef	RETSIGTYPE (*handler_t) ARGS((in
 # define ksh_jmp_buf		jmp_buf
 #endif /* HAVE_SIGSETJMP */
 
-/* Find a integer type that is at least 32 bits (or die) - SIZEOF_* defined
- * by autoconf (assumes an 8 bit byte, but I'm not concerned).
- * NOTE: INT32 may end up being more than 32 bits.
- */
-#if SIZEOF_INT >= 4
-# define INT32	int
-#else /* SIZEOF_INT */
-# if SIZEOF_LONG >= 4
-#  define INT32	long
-# else /* SIZEOF_LONG */
-   #error cannot find 32 bit type...
-# endif /* SIZEOF_LONG */
-#endif /* SIZEOF_INT */
-
 /* end of common headers */
 
 /* Stop gcc and lint from complaining about possibly uninitialized variables */
@@ -187,7 +174,7 @@ typedef int bool_t;
 #define	BIT(i)	(1<<(i))	/* define bit in flag */
 
 /* Table flag type - needs > 16 and < 32 bits */
-typedef INT32 Tflag;
+typedef int_least32_t Tflag;
 
 #define	NUFILE	32		/* Number of user-accessible files */
 #define	FDBASE	10		/* First file usable by Shell */
@@ -495,7 +482,7 @@ EXTERN Getopt user_opt;		/* parsing stat
 #ifdef KSH
 /* This for co-processes */
 
-typedef INT32 Coproc_id; /* something that won't (realisticly) wrap */
+typedef int_least32_t Coproc_id; /* something that won't (realisticly) wrap */
 struct coproc {
 	int	read;		/* pipe from co-process's stdout */
 	int	readw;		/* other side of read (saved temporarily) */



CVS commit: src/bin/ksh

2017-06-22 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 23 00:29:42 UTC 2017

Modified Files:
src/bin/ksh: config.h jobs.c sh.h

Log Message:
ksh: Replace homegrown int_least32_t with the C99 version


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/bin/ksh/config.h
cvs rdiff -u -r1.13 -r1.14 src/bin/ksh/jobs.c
cvs rdiff -u -r1.28 -r1.29 src/bin/ksh/sh.h

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



CVS commit: src/bin/ksh

2017-06-22 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 23 00:20:23 UTC 2017

Modified Files:
src/bin/ksh: config.h

Log Message:
ksh: Drop support for systems that return void for closedir(2)


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/bin/ksh/config.h

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



CVS commit: src/bin/ksh

2017-06-22 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 23 00:20:23 UTC 2017

Modified Files:
src/bin/ksh: config.h

Log Message:
ksh: Drop support for systems that return void for closedir(2)


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/bin/ksh/config.h

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

Modified files:

Index: src/bin/ksh/config.h
diff -u src/bin/ksh/config.h:1.35 src/bin/ksh/config.h:1.36
--- src/bin/ksh/config.h:1.35	Fri Jun 23 00:00:58 2017
+++ src/bin/ksh/config.h	Fri Jun 23 00:20:22 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: config.h,v 1.35 2017/06/23 00:00:58 kamil Exp $	*/
+/*	$NetBSD: config.h,v 1.36 2017/06/23 00:20:22 kamil Exp $	*/
 
 /* config.h.  Generated automatically by configure.  */
 /* config.h.in.  Generated automatically from configure.in by autoheader.  */
@@ -54,9 +54,6 @@
 /* Define to `int' if  doesn't define.  */
 /* #undef uid_t */
 
-/* Define if the closedir function returns void instead of int.  */
-/* #undef VOID_CLOSEDIR */
-
 /* Define if your kernel doesn't handle scripts starting with #! */
 /* #undef SHARPBANG */
 



CVS commit: src/bin/ksh

2017-06-22 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 23 00:18:01 UTC 2017

Modified Files:
src/bin/ksh: io.c lex.c sh.h shf.c tree.c

Log Message:
ksh: Use ANSI C varargs, drop support for older version 


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/bin/ksh/io.c
cvs rdiff -u -r1.18 -r1.19 src/bin/ksh/lex.c
cvs rdiff -u -r1.27 -r1.28 src/bin/ksh/sh.h
cvs rdiff -u -r1.10 -r1.11 src/bin/ksh/shf.c
cvs rdiff -u -r1.6 -r1.7 src/bin/ksh/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/bin/ksh/io.c
diff -u src/bin/ksh/io.c:1.13 src/bin/ksh/io.c:1.14
--- src/bin/ksh/io.c:1.13	Thu Jun 22 19:41:07 2017
+++ src/bin/ksh/io.c	Fri Jun 23 00:18:01 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: io.c,v 1.13 2017/06/22 19:41:07 kamil Exp $	*/
+/*	$NetBSD: io.c,v 1.14 2017/06/23 00:18:01 kamil Exp $	*/
 
 /*
  * shell buffered IO and formatted output
@@ -6,7 +6,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: io.c,v 1.13 2017/06/22 19:41:07 kamil Exp $");
+__RCSID("$NetBSD: io.c,v 1.14 2017/06/23 00:18:01 kamil Exp $");
 #endif
 
 
@@ -37,7 +37,7 @@ errorf(fmt, va_alist)
 	exstat = 1;
 	if (*fmt) {
 		error_prefix(TRUE);
-		SH_VA_START(va, fmt);
+		va_start(va, fmt);
 		shf_vfprintf(shl_out, fmt, va);
 		va_end(va);
 		shf_putchar('\n', shl_out);
@@ -60,7 +60,7 @@ warningf(fileline, fmt, va_alist)
 	va_list va;
 
 	error_prefix(fileline);
-	SH_VA_START(va, fmt);
+	va_start(va, fmt);
 	shf_vfprintf(shl_out, fmt, va);
 	va_end(va);
 	shf_putchar('\n', shl_out);
@@ -88,7 +88,7 @@ bi_errorf(fmt, va_alist)
 		/* not set when main() calls parse_args() */
 		if (builtin_argv0)
 			shf_fprintf(shl_out, "%s: ", builtin_argv0);
-		SH_VA_START(va, fmt);
+		va_start(va, fmt);
 		shf_vfprintf(shl_out, fmt, va);
 		va_end(va);
 		shf_putchar('\n', shl_out);
@@ -121,7 +121,7 @@ internal_errorf(jump, fmt, va_alist)
 
 	error_prefix(TRUE);
 	shf_fprintf(shl_out, "internal error: ");
-	SH_VA_START(va, fmt);
+	va_start(va, fmt);
 	shf_vfprintf(shl_out, fmt, va);
 	va_end(va);
 	shf_putchar('\n', shl_out);
@@ -160,7 +160,7 @@ shellf(fmt, va_alist)
 
 	if (!initio_done) /* shl_out may not be set up yet... */
 		return;
-	SH_VA_START(va, fmt);
+	va_start(va, fmt);
 	shf_vfprintf(shl_out, fmt, va);
 	va_end(va);
 	shf_flush(shl_out);
@@ -180,7 +180,7 @@ shprintf(fmt, va_alist)
 
 	if (!shl_stdout_ok)
 		internal_errorf(1, "shl_stdout not valid");
-	SH_VA_START(va, fmt);
+	va_start(va, fmt);
 	shf_vfprintf(shl_stdout, fmt, va);
 	va_end(va);
 }
@@ -216,7 +216,7 @@ kshdebug_printf_(fmt, va_alist)
 
 	if (!kshdebug_shf)
 		return;
-	SH_VA_START(va, fmt);
+	va_start(va, fmt);
 	shf_fprintf(kshdebug_shf, "[%d] ", getpid());
 	shf_vfprintf(kshdebug_shf, fmt, va);
 	va_end(va);

Index: src/bin/ksh/lex.c
diff -u src/bin/ksh/lex.c:1.18 src/bin/ksh/lex.c:1.19
--- src/bin/ksh/lex.c:1.18	Thu Jun 22 14:20:46 2017
+++ src/bin/ksh/lex.c	Fri Jun 23 00:18:01 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: lex.c,v 1.18 2017/06/22 14:20:46 kamil Exp $	*/
+/*	$NetBSD: lex.c,v 1.19 2017/06/23 00:18:01 kamil Exp $	*/
 
 /*
  * lexical analysis and source input
@@ -6,7 +6,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: lex.c,v 1.18 2017/06/22 14:20:46 kamil Exp $");
+__RCSID("$NetBSD: lex.c,v 1.19 2017/06/23 00:18:01 kamil Exp $");
 #endif
 
 
@@ -852,7 +852,7 @@ yyerror(fmt, va_alist)
 	source->str = null;	/* zap pending input */
 
 	error_prefix(TRUE);
-	SH_VA_START(va, fmt);
+	va_start(va, fmt);
 	shf_vfprintf(shl_out, fmt, va);
 	va_end(va);
 	errorf("%s", null);

Index: src/bin/ksh/sh.h
diff -u src/bin/ksh/sh.h:1.27 src/bin/ksh/sh.h:1.28
--- src/bin/ksh/sh.h:1.27	Fri Jun 23 00:09:36 2017
+++ src/bin/ksh/sh.h	Fri Jun 23 00:18:01 2017
@@ -1,10 +1,10 @@
-/*	$NetBSD: sh.h,v 1.27 2017/06/23 00:09:36 kamil Exp $	*/
+/*	$NetBSD: sh.h,v 1.28 2017/06/23 00:18:01 kamil Exp $	*/
 
 /*
  * Public Domain Bourne/Korn shell
  */
 
-/* $Id: sh.h,v 1.27 2017/06/23 00:09:36 kamil Exp $ */
+/* $Id: sh.h,v 1.28 2017/06/23 00:18:01 kamil Exp $ */
 
 #include "config.h"	/* system and option configuration info */
 
@@ -23,15 +23,7 @@
 #include 
 #include 
 #include 
-
-#ifdef HAVE_PROTOTYPES
-# include 
-# define SH_VA_START(va, argn) va_start(va, argn)
-#else
-# include 
-# define SH_VA_START(va, argn) va_start(va)
-#endif /* HAVE_PROTOTYPES */
-
+#include 
 #include 
 #include 
 

Index: src/bin/ksh/shf.c
diff -u src/bin/ksh/shf.c:1.10 src/bin/ksh/shf.c:1.11
--- src/bin/ksh/shf.c:1.10	Thu Jun 22 14:20:46 2017
+++ src/bin/ksh/shf.c	Fri Jun 23 00:18:01 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: shf.c,v 1.10 2017/06/22 14:20:46 kamil Exp $	*/
+/*	$NetBSD: shf.c,v 1.11 2017/06/23 00:18:01 kamil Exp $	*/
 
 /*
  *  Shell file I/O routines
@@ -6,7 +6,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: shf.c,v 1.10 2017/06/22 14:20:46 kamil Exp $");
+__RCSID("$NetBSD: shf.c,v 1.11 2017/06/23 00:18:01 kamil Exp $");
 #endif
 
 
@@ -770,7 +770,7 @@ shf_fprintf(shf, fmt, va_alist)
 	

CVS commit: src/bin/ksh

2017-06-22 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 23 00:18:01 UTC 2017

Modified Files:
src/bin/ksh: io.c lex.c sh.h shf.c tree.c

Log Message:
ksh: Use ANSI C varargs, drop support for older version 


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/bin/ksh/io.c
cvs rdiff -u -r1.18 -r1.19 src/bin/ksh/lex.c
cvs rdiff -u -r1.27 -r1.28 src/bin/ksh/sh.h
cvs rdiff -u -r1.10 -r1.11 src/bin/ksh/shf.c
cvs rdiff -u -r1.6 -r1.7 src/bin/ksh/tree.c

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



re: CVS commit: src/bin/ksh

2017-06-22 Thread matthew green
"Kamil Rytarowski" writes:
> Module Name:  src
> Committed By: kamil
> Date: Thu Jun 22 13:32:04 UTC 2017
> 
> Modified Files:
>   src/bin/ksh: c_ksh.c edit.c path.c sh.h
> 
> Log Message:
> Remove ancient cygwin support in ksh(1)
> 
> OK by 

i thought ksh was upstream owned code, so changes like this
seem to be out of place in netbsd tree.

why are you doing all this?


.mrg.


CVS commit: src/bin/ksh

2017-06-22 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 23 00:11:01 UTC 2017

Modified Files:
src/bin/ksh: tty.c

Log Message:
ksh: Remove remnant hack for SCO UNIX in tty code


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/bin/ksh/tty.c

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

Modified files:

Index: src/bin/ksh/tty.c
diff -u src/bin/ksh/tty.c:1.6 src/bin/ksh/tty.c:1.7
--- src/bin/ksh/tty.c:1.6	Fri Jun 23 00:09:36 2017
+++ src/bin/ksh/tty.c	Fri Jun 23 00:11:01 2017
@@ -1,9 +1,9 @@
-/*	$NetBSD: tty.c,v 1.6 2017/06/23 00:09:36 kamil Exp $	*/
+/*	$NetBSD: tty.c,v 1.7 2017/06/23 00:11:01 kamil Exp $	*/
 
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: tty.c,v 1.6 2017/06/23 00:09:36 kamil Exp $");
+__RCSID("$NetBSD: tty.c,v 1.7 2017/06/23 00:11:01 kamil Exp $");
 #endif
 
 
@@ -109,8 +109,6 @@ tty_init(init_ttystate)
 	}
 	tty_devtty = 1;
 
-	/* SCO can't job control on /dev/tty, so don't try... */
-#if !defined(__SCO__)
 	if ((tfd = open(devtty, O_RDWR, 0)) < 0) {
 		if (tfd < 0) {
 			tty_devtty = 0;
@@ -119,9 +117,6 @@ tty_init(init_ttystate)
 devtty, strerror(errno));
 		}
 	}
-#else /* !__SCO__ */
-	tfd = -1;
-#endif /* __SCO__ */
 
 	if (tfd < 0) {
 		do_close = 0;



CVS commit: src/bin/ksh

2017-06-22 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 23 00:11:01 UTC 2017

Modified Files:
src/bin/ksh: tty.c

Log Message:
ksh: Remove remnant hack for SCO UNIX in tty code


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/bin/ksh/tty.c

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



CVS commit: src/bin/ksh

2017-06-22 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 23 00:09:36 UTC 2017

Modified Files:
src/bin/ksh: sh.h tty.c

Log Message:
ksh: Remove support for NeXT Operating System


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/bin/ksh/sh.h
cvs rdiff -u -r1.5 -r1.6 src/bin/ksh/tty.c

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

Modified files:

Index: src/bin/ksh/sh.h
diff -u src/bin/ksh/sh.h:1.26 src/bin/ksh/sh.h:1.27
--- src/bin/ksh/sh.h:1.26	Thu Jun 22 23:50:24 2017
+++ src/bin/ksh/sh.h	Fri Jun 23 00:09:36 2017
@@ -1,10 +1,10 @@
-/*	$NetBSD: sh.h,v 1.26 2017/06/22 23:50:24 kamil Exp $	*/
+/*	$NetBSD: sh.h,v 1.27 2017/06/23 00:09:36 kamil Exp $	*/
 
 /*
  * Public Domain Bourne/Korn shell
  */
 
-/* $Id: sh.h,v 1.26 2017/06/22 23:50:24 kamil Exp $ */
+/* $Id: sh.h,v 1.27 2017/06/23 00:09:36 kamil Exp $ */
 
 #include "config.h"	/* system and option configuration info */
 
@@ -553,11 +553,7 @@ EXTERN	int	x_cols I__(80);	/* tty column
 
 /* Determine the location of the system (common) profile */
 #ifndef KSH_SYSTEM_PROFILE
-# ifdef __NeXT
-#  define KSH_SYSTEM_PROFILE "/etc/profile.std"
-# else /* __NeXT */
-#  define KSH_SYSTEM_PROFILE "/etc/profile"
-# endif /* __NeXT */
+# define KSH_SYSTEM_PROFILE "/etc/profile"
 #endif /* KSH_SYSTEM_PROFILE */
 
 /* Used by v_evaluate() and setstr() to control action when error occurs */

Index: src/bin/ksh/tty.c
diff -u src/bin/ksh/tty.c:1.5 src/bin/ksh/tty.c:1.6
--- src/bin/ksh/tty.c:1.5	Fri Jun 23 00:04:20 2017
+++ src/bin/ksh/tty.c	Fri Jun 23 00:09:36 2017
@@ -1,9 +1,9 @@
-/*	$NetBSD: tty.c,v 1.5 2017/06/23 00:04:20 kamil Exp $	*/
+/*	$NetBSD: tty.c,v 1.6 2017/06/23 00:09:36 kamil Exp $	*/
 
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: tty.c,v 1.5 2017/06/23 00:04:20 kamil Exp $");
+__RCSID("$NetBSD: tty.c,v 1.6 2017/06/23 00:09:36 kamil Exp $");
 #endif
 
 
@@ -112,22 +112,6 @@ tty_init(init_ttystate)
 	/* SCO can't job control on /dev/tty, so don't try... */
 #if !defined(__SCO__)
 	if ((tfd = open(devtty, O_RDWR, 0)) < 0) {
-#ifdef __NeXT
-		/* rlogin on NeXT boxes does not set up the controlling tty,
-		 * so force it to be done here...
-		 */
-		{
-			extern char *ttyname ARGS((int));
-			char *s = ttyname(isatty(2) ? 2 : 0);
-			int fd;
-
-			if (s && (fd = open(s, O_RDWR, 0)) >= 0) {
-close(fd);
-tfd = open(devtty, O_RDWR, 0);
-			}
-		}
-#endif /* __NeXT */
-
 		if (tfd < 0) {
 			tty_devtty = 0;
 			warningf(FALSE,



CVS commit: src/bin/ksh

2017-06-22 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 23 00:09:36 UTC 2017

Modified Files:
src/bin/ksh: sh.h tty.c

Log Message:
ksh: Remove support for NeXT Operating System


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/bin/ksh/sh.h
cvs rdiff -u -r1.5 -r1.6 src/bin/ksh/tty.c

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



CVS commit: src/bin/ksh

2017-06-22 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 23 00:07:15 UTC 2017

Modified Files:
src/bin/ksh: sigact.c

Log Message:
ksh: Drop the latest ifdef for BSD4.1 and eliminate dead code around it


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/bin/ksh/sigact.c

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



CVS commit: src/bin/ksh

2017-06-22 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 23 00:07:15 UTC 2017

Modified Files:
src/bin/ksh: sigact.c

Log Message:
ksh: Drop the latest ifdef for BSD4.1 and eliminate dead code around it


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/bin/ksh/sigact.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/ksh/sigact.c
diff -u src/bin/ksh/sigact.c:1.6 src/bin/ksh/sigact.c:1.7
--- src/bin/ksh/sigact.c:1.6	Thu Jun 22 23:59:28 2017
+++ src/bin/ksh/sigact.c	Fri Jun 23 00:07:15 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: sigact.c,v 1.6 2017/06/22 23:59:28 kamil Exp $	*/
+/*	$NetBSD: sigact.c,v 1.7 2017/06/23 00:07:15 kamil Exp $	*/
 
 /* NAME:
  *  sigact.c - fake sigaction(2)
@@ -141,7 +141,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: sigact.c,v 1.6 2017/06/22 23:59:28 kamil Exp $");
+__RCSID("$NetBSD: sigact.c,v 1.7 2017/06/23 00:07:15 kamil Exp $");
 #endif
 
 
@@ -169,28 +169,6 @@ __RCSID("$NetBSD: sigact.c,v 1.6 2017/06
 
 #define USE_SIGMASK
 
-/*
- * if we haven't been told,
- * try and guess what we should implement with.
- */
-#if !defined(USE_SIGSET) && !defined(USE_SIGMASK) && !defined(USE_SIGNAL)
-# if defined(sigmask) || defined(BSD) || defined(_BSD) && !defined(BSD41)
-#   define USE_SIGMASK
-# else
-#   ifndef NO_SIGSET
-# define USE_SIGSET
-#   else
-# define USE_SIGNAL
-#   endif
-# endif
-#endif
-/*
- * if we still don't know, we're in trouble
- */
-#if !defined(USE_SIGSET) && !defined(USE_SIGMASK) && !defined(USE_SIGNAL)
-error must know what to implement with
-#endif
-
 #include "sigact.h"
 
 /*



CVS commit: src/bin/ksh

2017-06-22 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 23 00:04:20 UTC 2017

Modified Files:
src/bin/ksh: tty.c

Log Message:
ksh: Drop BSD4.3 temporary hack in tty code


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/bin/ksh/tty.c

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

Modified files:

Index: src/bin/ksh/tty.c
diff -u src/bin/ksh/tty.c:1.4 src/bin/ksh/tty.c:1.5
--- src/bin/ksh/tty.c:1.4	Mon Jun 23 11:39:06 2003
+++ src/bin/ksh/tty.c	Fri Jun 23 00:04:20 2017
@@ -1,9 +1,9 @@
-/*	$NetBSD: tty.c,v 1.4 2003/06/23 11:39:06 agc Exp $	*/
+/*	$NetBSD: tty.c,v 1.5 2017/06/23 00:04:20 kamil Exp $	*/
 
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: tty.c,v 1.4 2003/06/23 11:39:06 agc Exp $");
+__RCSID("$NetBSD: tty.c,v 1.5 2017/06/23 00:04:20 kamil Exp $");
 #endif
 
 
@@ -74,16 +74,6 @@ set_tty(fd, ts, flags)
 			ret = -1;
 #   endif
 #  else /* HAVE_TERMIO_H */
-#   if defined(__mips) && (defined(_SYSTYPE_BSD43) || defined(__SYSTYPE_BSD43))
-	/* Under RISC/os 5.00, bsd43 environment, after a tty driver
-	 * generated interrupt (eg, INTR, TSTP), all output to tty is
-	 * lost until a SETP is done (there must be a better way of
-	 * doing this...).
-	 */
-	if (flags & TF_MIPSKLUDGE)
-		ret = ioctl(fd, TIOCSETP, >sgttyb);
-	else
-#   endif /* _SYSTYPE_BSD43 */
 	ret = ioctl(fd, TIOCSETN, >sgttyb);
 #   ifdef TIOCGATC
 	if (ioctl(fd, TIOCSATC, >lchars) < 0)
@@ -138,15 +128,12 @@ tty_init(init_ttystate)
 		}
 #endif /* __NeXT */
 
-/* X11R5 xterm on mips doesn't set controlling tty properly - temporary hack */
-# if !defined(__mips) || !(defined(_SYSTYPE_BSD43) || defined(__SYSTYPE_BSD43))
 		if (tfd < 0) {
 			tty_devtty = 0;
 			warningf(FALSE,
 "No controlling tty (open %s: %s)",
 devtty, strerror(errno));
 		}
-# endif /* __mips  */
 	}
 #else /* !__SCO__ */
 	tfd = -1;



CVS commit: src/bin/ksh

2017-06-22 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 23 00:04:20 UTC 2017

Modified Files:
src/bin/ksh: tty.c

Log Message:
ksh: Drop BSD4.3 temporary hack in tty code


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/bin/ksh/tty.c

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



CVS commit: src/bin/ksh

2017-06-22 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 23 00:00:58 UTC 2017

Modified Files:
src/bin/ksh: config.h trap.c

Log Message:
ksh: Drop support for UNIX V7-style signal routines


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/bin/ksh/config.h
cvs rdiff -u -r1.11 -r1.12 src/bin/ksh/trap.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/ksh/config.h
diff -u src/bin/ksh/config.h:1.34 src/bin/ksh/config.h:1.35
--- src/bin/ksh/config.h:1.34	Thu Jun 22 23:59:28 2017
+++ src/bin/ksh/config.h	Fri Jun 23 00:00:58 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: config.h,v 1.34 2017/06/22 23:59:28 kamil Exp $	*/
+/*	$NetBSD: config.h,v 1.35 2017/06/23 00:00:58 kamil Exp $	*/
 
 /* config.h.  Generated automatically by configure.  */
 /* config.h.in.  Generated automatically from configure.in by autoheader.  */
@@ -66,9 +66,6 @@
 /* Define if you have posix signal routines (sigaction(), et. al.) */
 #define POSIX_SIGNALS 1
 
-/* Define if you have v7 signal routines (signal(), signal reset on delivery) */
-/* #undef V7_SIGNALS */
-
 /* Define to use the fake posix signal routines (sigact.[ch]) */
 /* #undef USE_FAKE_SIGACT */
 

Index: src/bin/ksh/trap.c
diff -u src/bin/ksh/trap.c:1.11 src/bin/ksh/trap.c:1.12
--- src/bin/ksh/trap.c:1.11	Thu Jun 22 14:20:46 2017
+++ src/bin/ksh/trap.c	Fri Jun 23 00:00:58 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.11 2017/06/22 14:20:46 kamil Exp $	*/
+/*	$NetBSD: trap.c,v 1.12 2017/06/23 00:00:58 kamil Exp $	*/
 
 /*
  * signal handling
@@ -6,7 +6,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: trap.c,v 1.11 2017/06/22 14:20:46 kamil Exp $");
+__RCSID("$NetBSD: trap.c,v 1.12 2017/06/23 00:00:58 kamil Exp $");
 #endif
 
 #include "sh.h"
@@ -141,10 +141,7 @@ trapsig(i)
 	}
 	if (p->shtrap)
 		(*p->shtrap)(i);
-#ifdef V7_SIGNALS
-	if (sigtraps[i].cursig == trapsig) /* this for SIGCHLD,SIGALRM */
-		sigaction(i, _trap, (struct sigaction *) 0);
-#endif /* V7_SIGNALS */
+
 	errno = errno_;
 	return RETSIGVAL;
 }



CVS commit: src/bin/ksh

2017-06-22 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 23 00:00:58 UTC 2017

Modified Files:
src/bin/ksh: config.h trap.c

Log Message:
ksh: Drop support for UNIX V7-style signal routines


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/bin/ksh/config.h
cvs rdiff -u -r1.11 -r1.12 src/bin/ksh/trap.c

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



CVS commit: src/bin/ksh

2017-06-22 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Jun 22 23:59:29 UTC 2017

Modified Files:
src/bin/ksh: conf-end.h config.h sigact.c

Log Message:
ksh: Drop fallback for BSD4.2 signal routines


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/bin/ksh/conf-end.h
cvs rdiff -u -r1.33 -r1.34 src/bin/ksh/config.h
cvs rdiff -u -r1.5 -r1.6 src/bin/ksh/sigact.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/ksh/conf-end.h
diff -u src/bin/ksh/conf-end.h:1.3 src/bin/ksh/conf-end.h:1.4
--- src/bin/ksh/conf-end.h:1.3	Thu Jun 22 23:54:13 2017
+++ src/bin/ksh/conf-end.h	Thu Jun 22 23:59:28 2017
@@ -1,9 +1,9 @@
-/*	$NetBSD: conf-end.h,v 1.3 2017/06/22 23:54:13 kamil Exp $	*/
+/*	$NetBSD: conf-end.h,v 1.4 2017/06/22 23:59:28 kamil Exp $	*/
 
 /*
  * End of configuration stuff for PD ksh.
  *
- * RCSid: $NetBSD: conf-end.h,v 1.3 2017/06/22 23:54:13 kamil Exp $
+ * RCSid: $NetBSD: conf-end.h,v 1.4 2017/06/22 23:59:28 kamil Exp $
  */
 
 #if defined(EMACS) || defined(VI)
@@ -24,7 +24,7 @@
 
 /* Can we safely catch sigchld and wait for processes? */
 #if (defined(HAVE_WAITPID) || defined(HAVE_WAIT3)) \
-&& (defined(POSIX_SIGNALS) || defined(BSD42_SIGNALS))
+&& (defined(POSIX_SIGNALS))
 # define JOB_SIGS
 #endif
 

Index: src/bin/ksh/config.h
diff -u src/bin/ksh/config.h:1.33 src/bin/ksh/config.h:1.34
--- src/bin/ksh/config.h:1.33	Thu Jun 22 23:56:24 2017
+++ src/bin/ksh/config.h	Thu Jun 22 23:59:28 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: config.h,v 1.33 2017/06/22 23:56:24 kamil Exp $	*/
+/*	$NetBSD: config.h,v 1.34 2017/06/22 23:59:28 kamil Exp $	*/
 
 /* config.h.  Generated automatically by configure.  */
 /* config.h.in.  Generated automatically from configure.in by autoheader.  */
@@ -66,9 +66,6 @@
 /* Define if you have posix signal routines (sigaction(), et. al.) */
 #define POSIX_SIGNALS 1
 
-/* Define if you have BSD4.2 signal routines (sigsetmask(), et. al.) */
-/* #undef BSD42_SIGNALS */
-
 /* Define if you have v7 signal routines (signal(), signal reset on delivery) */
 /* #undef V7_SIGNALS */
 

Index: src/bin/ksh/sigact.c
diff -u src/bin/ksh/sigact.c:1.5 src/bin/ksh/sigact.c:1.6
--- src/bin/ksh/sigact.c:1.5	Thu Jun 22 23:56:24 2017
+++ src/bin/ksh/sigact.c	Thu Jun 22 23:59:28 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: sigact.c,v 1.5 2017/06/22 23:56:24 kamil Exp $	*/
+/*	$NetBSD: sigact.c,v 1.6 2017/06/22 23:59:28 kamil Exp $	*/
 
 /* NAME:
  *  sigact.c - fake sigaction(2)
@@ -141,7 +141,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: sigact.c,v 1.5 2017/06/22 23:56:24 kamil Exp $");
+__RCSID("$NetBSD: sigact.c,v 1.6 2017/06/22 23:59:28 kamil Exp $");
 #endif
 
 
@@ -167,12 +167,7 @@ __RCSID("$NetBSD: sigact.c,v 1.5 2017/06
 #ifdef USE_FAKE_SIGACT /* let autoconf decide.. */
 /* #if !defined(SA_NOCLDSTOP) || defined(_SIGACT_H) || defined(USE_SIGNAL) || defined(USE_SIGSET) || defined(USE_SIGMASK) */
 
-/* Let autoconf decide which to use */
-#ifdef BSD42_SIGNALS
-# define USE_SIGMASK
-#else
-# define USE_SIGNAL
-#endif /* BSD42_SIGNALS */
+#define USE_SIGMASK
 
 /*
  * if we haven't been told,



CVS commit: src/bin/ksh

2017-06-22 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Jun 22 23:59:29 UTC 2017

Modified Files:
src/bin/ksh: conf-end.h config.h sigact.c

Log Message:
ksh: Drop fallback for BSD4.2 signal routines


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/bin/ksh/conf-end.h
cvs rdiff -u -r1.33 -r1.34 src/bin/ksh/config.h
cvs rdiff -u -r1.5 -r1.6 src/bin/ksh/sigact.c

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



CVS commit: src/bin/ksh

2017-06-22 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Jun 22 23:56:24 UTC 2017

Modified Files:
src/bin/ksh: config.h sigact.c

Log Message:
ksh: Remove fallback to BSD4.1 signal routines


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/bin/ksh/config.h
cvs rdiff -u -r1.4 -r1.5 src/bin/ksh/sigact.c

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



  1   2   3   >