git: 9front

Download patch

ref: 95c324d18b7a37fac99152cfb722e6ed21d17eeb
parent: f2cdfce858b21c8d619ecdd456b100bc0feab9e1
author: spew <devnull@localhost>
date: Mon May 2 11:11:48 EDT 2016

fix e2 production to match regexp(6) and do it right this time

--- a/sys/src/libregexp/regcomp.c
+++ b/sys/src/libregexp/regcomp.c
@@ -78,14 +78,17 @@
 	Renode *n;
 
 	n = e3(plex);
-	if(lex(plex) == LREP) {
+	while(lex(plex) == LREP) {
 		switch(plex->rune) {
 		case L'*':
-			return node(plex, TSTAR, n, nil);
+			n = node(plex, TSTAR, n, nil);
+			break;
 		case L'+':
-			return node(plex, TPLUS, n, nil);
+			n = node(plex, TPLUS, n, nil);
+			break;
 		case L'?':
-			return node(plex, TQUES, n, nil);
+			n = node(plex, TQUES, n, nil);
+			break;
 		}
 	}
 	plex->peek = 1;
--