commit: 6325ed2e606e1ec16c3bb6f0e0cd8e65d1a53602
parent: 5e29a758b1ba8937fd252de04769c636129c469d
author: Brian Callahan <bcallah@openbsd.org>
date: Sun, 20 Feb 2022 14:48:10 -0500
OpenBSD cranked to 7.1-beta, so sync oksh in preparation.
Adds the following commit to misc.c:
revision 1.78
date: 2021/12/24 22:08:37; author: deraadt; state: Exp; lines: +3 -3; commitid: mObak0n0Zwfi4u9a;
when getopts prints "unknown option" or "requires argument", it should
not print the shell script line number where this occured. Doing so is
pointless, or an information leak.
This change does not affect any other error reporting.
ok millert
2 files changed, 34 insertions(+), 34 deletions(-)
diff --git a/CVS/Entries b/CVS/Entries
@@ -9,38 +9,38 @@
/eval.c/1.66/Result of merge//
/var.c/1.72/Result of merge//
/vi.c/1.60/Result of merge+Fri Mar 12 03:48:27 2021//
-/CONTRIBUTORS/1.11/Thu Dec 16 20:56:49 2021//
-/LEGAL/1.2/Thu Dec 16 20:56:49 2021//
-/Makefile/1.39/Thu Dec 16 20:56:58 2021//
-/NOTES/1.16/Thu Dec 16 20:56:49 2021//
-/PROJECTS/1.9/Thu Dec 16 20:56:49 2021//
-/README/1.16/Thu Dec 16 20:56:58 2021//
-/alloc.c/1.19/Thu Dec 16 20:56:49 2021//
-/c_ksh.c/1.62/Thu Dec 16 20:56:49 2021//
-/c_sh.c/1.64/Thu Dec 16 20:56:49 2021//
-/c_test.h/1.4/Thu Dec 16 20:56:49 2021//
-/c_ulimit.c/1.29/Thu Dec 16 20:56:49 2021//
-/edit.h/1.12/Thu Dec 16 20:56:49 2021//
/emacs.c/1.89/Result of merge//
/exec.c/1.75/Result of merge//
-/expand.h/1.15/Thu Dec 16 20:56:49 2021//
-/expr.c/1.34/Thu Dec 16 20:56:49 2021//
-/jobs.c/1.62/Thu Dec 16 20:56:49 2021//
-/ksh.1/1.215/Thu Dec 16 20:56:49 2021//
-/lex.c/1.78/Thu Dec 16 20:56:49 2021//
-/lex.h/1.21/Thu Dec 16 20:56:49 2021//
-/mail.c/1.27/Thu Dec 16 20:56:49 2021//
-/misc.c/1.77/Result of merge//
-/path.c/1.23/Thu Dec 16 20:56:49 2021//
-/sh.1/1.153/Thu Dec 16 20:56:49 2021//
-/shf.c/1.34/Thu Dec 16 20:56:49 2021//
-/shf.h/1.8/Thu Dec 16 20:56:49 2021//
-/syn.c/1.40/Thu Dec 16 20:56:49 2021//
-/table.c/1.25/Thu Dec 16 20:56:49 2021//
-/table.h/1.15/Thu Dec 16 20:56:49 2021//
-/tree.c/1.34/Thu Dec 16 20:56:49 2021//
-/tree.h/1.12/Thu Dec 16 20:56:49 2021//
/tty.c/1.19/Result of merge//
-/tty.h/1.6/Thu Dec 16 20:56:49 2021//
-/version.c/1.12/Thu Dec 16 20:56:49 2021//
+/CONTRIBUTORS/1.11/Sun Feb 20 19:46:57 2022//
+/LEGAL/1.2/Sun Feb 20 19:46:57 2022//
+/Makefile/1.39/Sun Feb 20 19:47:08 2022//
+/NOTES/1.16/Sun Feb 20 19:46:57 2022//
+/PROJECTS/1.9/Sun Feb 20 19:46:57 2022//
+/README/1.16/Sun Feb 20 19:47:08 2022//
+/alloc.c/1.19/Sun Feb 20 19:46:57 2022//
+/c_ksh.c/1.62/Sun Feb 20 19:46:57 2022//
+/c_sh.c/1.64/Sun Feb 20 19:46:57 2022//
+/c_test.h/1.4/Sun Feb 20 19:46:57 2022//
+/c_ulimit.c/1.29/Sun Feb 20 19:46:57 2022//
+/edit.h/1.12/Sun Feb 20 19:46:57 2022//
+/expand.h/1.15/Sun Feb 20 19:46:57 2022//
+/expr.c/1.34/Sun Feb 20 19:46:57 2022//
+/jobs.c/1.62/Sun Feb 20 19:46:57 2022//
+/ksh.1/1.215/Sun Feb 20 19:46:57 2022//
+/lex.c/1.78/Sun Feb 20 19:46:57 2022//
+/lex.h/1.21/Sun Feb 20 19:46:57 2022//
+/mail.c/1.27/Sun Feb 20 19:46:57 2022//
+/misc.c/1.78/Result of merge//
+/path.c/1.23/Sun Feb 20 19:46:57 2022//
+/sh.1/1.153/Sun Feb 20 19:46:57 2022//
+/shf.c/1.34/Sun Feb 20 19:46:57 2022//
+/shf.h/1.8/Sun Feb 20 19:46:57 2022//
+/syn.c/1.40/Sun Feb 20 19:46:57 2022//
+/table.c/1.25/Sun Feb 20 19:46:57 2022//
+/table.h/1.15/Sun Feb 20 19:46:57 2022//
+/tree.c/1.34/Sun Feb 20 19:46:57 2022//
+/tree.h/1.12/Sun Feb 20 19:46:57 2022//
+/tty.h/1.6/Sun Feb 20 19:46:57 2022//
+/version.c/1.12/Sun Feb 20 19:46:57 2022//
D
diff --git a/misc.c b/misc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: misc.c,v 1.77 2021/12/15 04:01:52 deraadt Exp $ */
+/* $OpenBSD: misc.c,v 1.78 2021/12/24 22:08:37 deraadt Exp $ */
/*
* Miscellaneous functions
@@ -908,7 +908,7 @@ ksh_getopt(char **argv, Getopt *go, const char *options)
go->buf[0] = c;
go->optarg = go->buf;
} else {
- warningf(true, "%s%s-%c: unknown option",
+ warningf(false, "%s%s-%c: unknown option",
(go->flags & GF_NONAME) ? "" : argv[0],
(go->flags & GF_NONAME) ? "" : ": ", c);
if (go->flags & GF_ERROR)
@@ -934,7 +934,7 @@ ksh_getopt(char **argv, Getopt *go, const char *options)
go->optarg = go->buf;
return ':';
}
- warningf(true, "%s%s-`%c' requires argument",
+ warningf(false, "%s%s-`%c' requires argument",
(go->flags & GF_NONAME) ? "" : argv[0],
(go->flags & GF_NONAME) ? "" : ": ", c);
if (go->flags & GF_ERROR)