commit: 33368f54067d74b523d1314a0231f918a4c0b3b2
parent: b793741d1341301fcdc01bf0ce5715dffcb711dd
author: Brian Callahan <bcallah@openbsd.org>
date: Sat, 11 Feb 2023 10:42:54 -0500
Chase the three latest ksh commits:
CVSROOT: /cvs
Module name: src
Changes by: kn@cvs.openbsd.org 2023/02/08 10:22:10
Modified files:
bin/ksh : lex.c main.c
distrib/special/ksh: Makefile
Log message:
Omit version in SMALL ksh builds
No need for KSH_VERSION and its PS1 esacape sequences in installer shells.
Save some bits and clean up what(1) output on ramdisk kernels.
OK deraadt
---
CVSROOT: /cvs
Module name: src
Changes by: jmc@cvs.openbsd.org 2022/12/26 10:45:28
Modified files:
bin/ksh : ksh.1
Log message:
reformat some multiline markup, which had been causing an unwanted
space (specifically in the "alias", "readonly" and "typeset"
commands);
from josiah frentsos
---
CVSROOT: /cvs
Module name: src
Changes by: sdk@cvs.openbsd.org 2022/12/19 01:19:50
Modified files:
bin/ksh : sh.1
Log message:
Remove array reference from sh(1) because sh doesn't have arrays.
Reported with diff from Ross L Richardson
Agreed kn, OK jmc
6 files changed, 56 insertions(+), 62 deletions(-)
diff --git a/CVS/Entries b/CVS/Entries
@@ -1,7 +1,6 @@
/config.h/1.19/Tue Jan 16 02:21:56 2018//
/c_test.c/1.27/Result of merge//
/edit.c/1.69/Result of merge//
-/main.c/1.98/Result of merge//
/io.c/1.38/Result of merge//
/history.c/1.84/Result of merge//
/trap.c/1.33/Tue Dec 17 00:39:35 2019//
@@ -12,35 +11,36 @@
/emacs.c/1.89/Result of merge//
/tty.c/1.19/Result of merge//
/misc.c/1.78/Result of merge//
-/CONTRIBUTORS/1.11/Wed Oct 26 01:59:06 2022//
-/LEGAL/1.2/Wed Oct 26 01:59:06 2022//
-/Makefile/1.39/Fri Oct 28 20:30:03 2022//
-/NOTES/1.16/Wed Oct 26 01:59:06 2022//
-/PROJECTS/1.9/Wed Oct 26 01:59:06 2022//
-/README/1.16/Fri Oct 28 20:30:03 2022//
-/alloc.c/1.19/Wed Oct 26 01:59:06 2022//
-/c_ksh.c/1.62/Wed Oct 26 01:59:06 2022//
-/c_sh.c/1.64/Wed Oct 26 01:59:06 2022//
-/c_test.h/1.4/Wed Oct 26 01:59:06 2022//
-/c_ulimit.c/1.29/Wed Oct 26 01:59:06 2022//
-/edit.h/1.12/Wed Oct 26 01:59:06 2022//
/exec.c/1.76/Result of merge//
-/expand.h/1.15/Wed Oct 26 01:59:06 2022//
-/expr.c/1.34/Wed Oct 26 01:59:06 2022//
-/jobs.c/1.62/Wed Oct 26 01:59:06 2022//
-/ksh.1/1.217/Fri Oct 28 20:30:03 2022//
-/lex.c/1.78/Wed Oct 26 01:59:06 2022//
-/lex.h/1.21/Wed Oct 26 01:59:06 2022//
-/mail.c/1.27/Wed Oct 26 01:59:06 2022//
-/path.c/1.23/Wed Oct 26 01:59:06 2022//
-/sh.1/1.155/Fri Oct 28 20:30:03 2022//
-/shf.c/1.34/Wed Oct 26 01:59:06 2022//
-/shf.h/1.8/Wed Oct 26 01:59:06 2022//
-/syn.c/1.40/Wed Oct 26 01:59:06 2022//
-/table.c/1.25/Wed Oct 26 01:59:06 2022//
-/table.h/1.15/Wed Oct 26 01:59:06 2022//
-/tree.c/1.34/Wed Oct 26 01:59:06 2022//
-/tree.h/1.12/Wed Oct 26 01:59:06 2022//
-/tty.h/1.6/Wed Oct 26 01:59:06 2022//
-/version.c/1.12/Wed Oct 26 01:59:06 2022//
+/CONTRIBUTORS/1.11/Sat Feb 11 15:36:54 2023//
+/LEGAL/1.2/Sat Feb 11 15:36:54 2023//
+/Makefile/1.39/Sat Feb 11 15:37:01 2023//
+/NOTES/1.16/Sat Feb 11 15:36:54 2023//
+/PROJECTS/1.9/Sat Feb 11 15:36:54 2023//
+/README/1.16/Sat Feb 11 15:37:01 2023//
+/alloc.c/1.19/Sat Feb 11 15:36:54 2023//
+/c_ksh.c/1.62/Sat Feb 11 15:36:54 2023//
+/c_sh.c/1.64/Sat Feb 11 15:36:54 2023//
+/c_test.h/1.4/Sat Feb 11 15:36:54 2023//
+/c_ulimit.c/1.29/Sat Feb 11 15:36:54 2023//
+/edit.h/1.12/Sat Feb 11 15:36:54 2023//
+/expand.h/1.15/Sat Feb 11 15:36:54 2023//
+/expr.c/1.34/Sat Feb 11 15:36:54 2023//
+/jobs.c/1.62/Sat Feb 11 15:36:54 2023//
+/ksh.1/1.218/Sat Feb 11 15:37:02 2023//
+/lex.c/1.79/Sat Feb 11 15:37:02 2023//
+/lex.h/1.21/Sat Feb 11 15:36:54 2023//
+/mail.c/1.27/Sat Feb 11 15:36:54 2023//
+/main.c/1.99/Result of merge+Sat Feb 11 15:37:02 2023//
+/path.c/1.23/Sat Feb 11 15:36:54 2023//
+/sh.1/1.156/Sat Feb 11 15:37:02 2023//
+/shf.c/1.34/Sat Feb 11 15:36:54 2023//
+/shf.h/1.8/Sat Feb 11 15:36:54 2023//
+/syn.c/1.40/Sat Feb 11 15:36:54 2023//
+/table.c/1.25/Sat Feb 11 15:36:54 2023//
+/table.h/1.15/Sat Feb 11 15:36:54 2023//
+/tree.c/1.34/Sat Feb 11 15:36:54 2023//
+/tree.h/1.12/Sat Feb 11 15:36:54 2023//
+/tty.h/1.6/Sat Feb 11 15:36:54 2023//
+/version.c/1.12/Sat Feb 11 15:36:54 2023//
D
diff --git a/ksh.1 b/ksh.1
@@ -1,8 +1,8 @@
-.\" $OpenBSD: ksh.1,v 1.217 2022/09/13 20:26:26 kn Exp $
+.\" $OpenBSD: ksh.1,v 1.218 2022/12/26 17:45:27 jmc Exp $
.\"
.\" Public Domain
.\"
-.Dd $Mdocdate: September 13 2022 $
+.Dd $Mdocdate: December 26 2022 $
.Dt KSH 1
.Os
.Sh NAME
@@ -2713,9 +2713,7 @@ Exit status is set to zero.
.Cm +-x Oc
.Op Fl p
.Op Cm +
-.Oo Ar name
-.Op Ns = Ns Ar value
-.Ar ... Oc
+.Op Ar name Ns Oo = Ns Ar value Oc Ar ...
.Xc
Without arguments,
.Ic alias
@@ -3454,9 +3452,7 @@ option is used, input is saved to the history file.
.It Xo
.Ic readonly
.Op Fl p
-.Oo Ar parameter
-.Op Ns = Ns Ar value
-.Ar ... Oc
+.Op Ar parameter Ns Oo = Ns Ar value Oc Ar ...
.Xc
Sets the read-only attribute of the named parameters.
If values are given,
@@ -4125,11 +4121,7 @@ Short form of
.Op Fl i Ns Op Ar n
.No \&| Fl f Op Fl tux
.Oc
-.Oo
-.Ar name
-.Op Ns = Ns Ar value
-.Ar ...
-.Oc
+.Op Ar name Ns Oo = Ns Ar value Oc Ar ...
.Xc
Display or set parameter attributes.
With no
diff --git a/lex.c b/lex.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lex.c,v 1.78 2018/01/15 14:58:05 jca Exp $ */
+/* $OpenBSD: lex.c,v 1.79 2023/02/08 17:22:10 kn Exp $ */
/*
* lexical analysis and source input
@@ -1335,6 +1335,7 @@ dopprompt(const char *sp, int ntruncate, const char **spp, int doprint)
case 'u': /* '\' 'u' username */
strlcpy(strbuf, username, sizeof strbuf);
break;
+#ifndef SMALL
case 'v': /* '\' 'v' version (short) */
p = strchr(ksh_version, ' ');
if (p)
@@ -1350,6 +1351,7 @@ dopprompt(const char *sp, int ntruncate, const char **spp, int doprint)
case 'V': /* '\' 'V' version (long) */
strlcpy(strbuf, ksh_version, sizeof strbuf);
break;
+#endif /* SMALL */
case 'w': /* '\' 'w' cwd */
p = str_val(global("PWD"));
n = strlen(str_val(global("HOME")));
diff --git a/main.c b/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.98 2019/06/28 13:34:59 deraadt Exp $ */
+/* $OpenBSD: main.c,v 1.99 2023/02/08 17:22:10 kn Exp $ */
/*
* startup, main loop, environments and error handling
@@ -81,8 +81,10 @@ static const char initifs[] = "IFS= \t\n";
static const char initsubs[] = "${PS2=> } ${PS3=#? } ${PS4=+ }";
static const char *initcoms [] = {
+#ifndef SMALL
"typeset", "-r", "KSH_VERSION", NULL,
"typeset", "-r", "OKSH_VERSION", NULL,
+#endif /* SMALL */
"typeset", "-x", "SHELL", "PATH", "HOME", "PWD", "OLDPWD", NULL,
"typeset", "-ir", "PPID", NULL,
"typeset", "-i", "OPTIND=1", NULL,
@@ -111,7 +113,9 @@ static const char *initcoms [] = {
char username[_PW_NAME_LEN + 1];
+#ifndef SMALL
#define version_param (initcoms[2])
+#endif /* SMALL */
/* The shell uses its own variation on argv, to build variables like
* $0 and $@.
@@ -250,7 +254,9 @@ main(int argc, char *argv[])
(strlen(kshname) >= 3 &&
!strcmp(&kshname[strlen(kshname) - 3], "/sh"))) {
Flag(FSH) = 1;
+#ifndef SMALL
version_param = "SH_VERSION";
+#endif /* SMALL */
}
/* Set edit mode to emacs by default, may be overridden
@@ -299,9 +305,11 @@ main(int argc, char *argv[])
}
ppid = getppid();
setint(global("PPID"), (int64_t) ppid);
+#ifndef SMALL
/* setstr can't fail here */
setstr(global(version_param), ksh_version, KSH_RETURN_ERROR);
setstr(global("OKSH_VERSION"), "oksh 7.2", KSH_RETURN_ERROR);
+#endif /* SMALL */
/* execute initialization statements */
for (wp = (char**) initcoms; *wp != NULL; wp++) {
diff --git a/oksh.1 b/oksh.1
@@ -1,8 +1,8 @@
-.\" $OpenBSD: ksh.1,v 1.217 2022/09/13 20:26:26 kn Exp $
+.\" $OpenBSD: ksh.1,v 1.218 2022/12/26 17:45:27 jmc Exp $
.\"
.\" Public Domain
.\"
-.Dd $Mdocdate: September 13 2022 $
+.Dd $Mdocdate: December 26 2022 $
.Dt OKSH 1
.Os
.Sh NAME
@@ -2713,9 +2713,7 @@ Exit status is set to zero.
.Cm +-x Oc
.Op Fl p
.Op Cm +
-.Oo Ar name
-.Op Ns = Ns Ar value
-.Ar ... Oc
+.Op Ar name Ns Oo = Ns Ar value Oc Ar ...
.Xc
Without arguments,
.Ic alias
@@ -3454,9 +3452,7 @@ option is used, input is saved to the history file.
.It Xo
.Ic readonly
.Op Fl p
-.Oo Ar parameter
-.Op Ns = Ns Ar value
-.Ar ... Oc
+.Op Ar parameter Ns Oo = Ns Ar value Oc Ar ...
.Xc
Sets the read-only attribute of the named parameters.
If values are given,
@@ -4125,11 +4121,7 @@ Short form of
.Op Fl i Ns Op Ar n
.No \&| Fl f Op Fl tux
.Oc
-.Oo
-.Ar name
-.Op Ns = Ns Ar value
-.Ar ...
-.Oc
+.Op Ar name Ns Oo = Ns Ar value Oc Ar ...
.Xc
Display or set parameter attributes.
With no
diff --git a/sh.1 b/sh.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: sh.1,v 1.155 2022/08/31 22:27:14 jmc Exp $
+.\" $OpenBSD: sh.1,v 1.156 2022/12/19 08:19:50 sdk Exp $
.\"
.\" Copyright (c) 2015 Jason McIntyre <jmc@openbsd.org>
.\"
@@ -14,7 +14,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: August 31 2022 $
+.Dd $Mdocdate: December 19 2022 $
.Dt SH 1
.Os
.Sh NAME
@@ -1390,7 +1390,7 @@ The format is:
.Pp
Where
.Ar expression
-is an integer, parameter name, or array reference,
+is an integer or parameter name,
optionally combined with any of the operators described below,
listed and grouped according to precedence:
.Bl -tag -width Ds