shithub: riscv

Download patch

ref: 7657312dcf5b9435ff848b20dfc3a0546ab8a500
parent: de5cabceafbda54d1a7397e6297f5fc1fb4759ce
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;