oksh-noxz

[fork] Portable OpenBSD ksh, based on the Public Domain Korn Shell (pdksh).
git clone https://noxz.tech/git/oksh-noxz.git
oksh-noxz

commit: 60610d7cd4bb537007b650f92c57c8aebb8b2acf
parent: 15d35ee2f15bbaee0e5dbb70c1f90914fbc1b4fd
author: Brian Callahan <bcallah@openbsd.org>
date:   Fri, 24 Jul 2020 21:42:58 -0400
Update from OpenBSD
---
revision 1.75
date: 2020/07/22 19:20:41;  author: millert;  state: Exp;  lines: +4 -1;  commitid: Tej2RU5tigjse4jC;
Collapse consecutive stars to avoid exponential behavior.
OK tb@
---
For more info see: https://marc.info/?l=openbsd-misc&m=159544517625473&w=2
MCVS/Entries64++++++++++----------
Mmisc.c5+-
2 files changed, 36 insertions(+), 33 deletions(-)
diff --git a/CVS/Entries b/CVS/Entries
@@ -10,37 +10,37 @@
 /trap.c/1.33/Tue Dec 17 00:39:35 2019//
 /var.c/1.71/Result of merge//
 /emacs.c/1.87/Result of merge//
-/CONTRIBUTORS/1.11/Sun Jul 12 14:32:42 2020//
-/LEGAL/1.2/Sun Jul 12 14:32:42 2020//
-/Makefile/1.39/Sun Jul 12 14:32:50 2020//
-/NOTES/1.16/Sun Jul 12 14:32:42 2020//
-/PROJECTS/1.9/Sun Jul 12 14:32:42 2020//
-/README/1.16/Sun Jul 12 14:32:50 2020//
-/alloc.c/1.19/Sun Jul 12 14:32:42 2020//
-/c_ksh.c/1.62/Sun Jul 12 14:32:42 2020//
-/c_sh.c/1.64/Sun Jul 12 14:32:50 2020//
-/c_test.h/1.4/Sun Jul 12 14:32:42 2020//
-/c_ulimit.c/1.29/Sun Jul 12 14:32:42 2020//
-/edit.h/1.12/Sun Jul 12 14:32:42 2020//
-/expand.h/1.15/Sun Jul 12 14:32:42 2020//
-/expr.c/1.34/Sun Jul 12 14:32:42 2020//
-/jobs.c/1.62/Sun Jul 12 14:32:50 2020//
-/ksh.1/1.209/Sun Jul 12 14:32:50 2020//
-/lex.c/1.78/Sun Jul 12 14:32:42 2020//
-/lex.h/1.21/Sun Jul 12 14:32:42 2020//
-/mail.c/1.27/Sun Jul 12 14:32:42 2020//
-/misc.c/1.74/Result of merge//
-/path.c/1.23/Sun Jul 12 14:32:42 2020//
-/sh.1/1.152/Sun Jul 12 14:32:42 2020//
 /sh.h/1.76/Result of merge//
-/shf.c/1.34/Sun Jul 12 14:32:42 2020//
-/shf.h/1.8/Sun Jul 12 14:32:42 2020//
-/syn.c/1.39/Sun Jul 12 14:32:42 2020//
-/table.c/1.25/Sun Jul 12 14:32:42 2020//
-/table.h/1.15/Sun Jul 12 14:32:42 2020//
-/tree.c/1.34/Sun Jul 12 14:32:42 2020//
-/tree.h/1.12/Sun Jul 12 14:32:42 2020//
-/tty.h/1.6/Sun Jul 12 14:32:42 2020//
-/version.c/1.12/Sun Jul 12 14:32:42 2020//
-/vi.c/1.56/Sun Jul 12 14:32:42 2020//
+/CONTRIBUTORS/1.11/Sat Jul 25 01:41:12 2020//
+/LEGAL/1.2/Sat Jul 25 01:41:12 2020//
+/Makefile/1.39/Sat Jul 25 01:41:20 2020//
+/NOTES/1.16/Sat Jul 25 01:41:12 2020//
+/PROJECTS/1.9/Sat Jul 25 01:41:12 2020//
+/README/1.16/Sat Jul 25 01:41:20 2020//
+/alloc.c/1.19/Sat Jul 25 01:41:12 2020//
+/c_ksh.c/1.62/Sat Jul 25 01:41:12 2020//
+/c_sh.c/1.64/Sat Jul 25 01:41:12 2020//
+/c_test.h/1.4/Sat Jul 25 01:41:12 2020//
+/c_ulimit.c/1.29/Sat Jul 25 01:41:12 2020//
+/edit.h/1.12/Sat Jul 25 01:41:12 2020//
+/expand.h/1.15/Sat Jul 25 01:41:12 2020//
+/expr.c/1.34/Sat Jul 25 01:41:12 2020//
+/jobs.c/1.62/Sat Jul 25 01:41:12 2020//
+/ksh.1/1.209/Sat Jul 25 01:41:12 2020//
+/lex.c/1.78/Sat Jul 25 01:41:12 2020//
+/lex.h/1.21/Sat Jul 25 01:41:12 2020//
+/mail.c/1.27/Sat Jul 25 01:41:12 2020//
+/misc.c/1.75/Result of merge//
+/path.c/1.23/Sat Jul 25 01:41:12 2020//
+/sh.1/1.152/Sat Jul 25 01:41:12 2020//
+/shf.c/1.34/Sat Jul 25 01:41:12 2020//
+/shf.h/1.8/Sat Jul 25 01:41:12 2020//
+/syn.c/1.39/Sat Jul 25 01:41:12 2020//
+/table.c/1.25/Sat Jul 25 01:41:12 2020//
+/table.h/1.15/Sat Jul 25 01:41:12 2020//
+/tree.c/1.34/Sat Jul 25 01:41:12 2020//
+/tree.h/1.12/Sat Jul 25 01:41:12 2020//
+/tty.h/1.6/Sat Jul 25 01:41:12 2020//
+/version.c/1.12/Sat Jul 25 01:41:12 2020//
+/vi.c/1.56/Sat Jul 25 01:41:12 2020//
 D
diff --git a/misc.c b/misc.c
@@ -1,4 +1,4 @@
-/*	$OpenBSD: misc.c,v 1.74 2020/07/07 10:33:58 jca Exp $	*/
+/*	$OpenBSD: misc.c,v 1.75 2020/07/22 19:20:41 millert Exp $	*/
 
 /*
  * Miscellaneous functions
@@ -617,6 +617,9 @@ do_gmatch(const unsigned char *s, const unsigned char *se,
 			break;
 
 		case '*':
+			/* collapse consecutive stars */
+			while (ISMAGIC(p[0]) && p[1] == '*')
+				p += 2;
 			if (p == pe)
 				return 1;
 			s--;