From 62390091b7ff715e9336cc69a3ee41a6c458221e Mon Sep 17 00:00:00 2001 From: rsc Date: Fri, 5 Mar 2004 05:13:56 +0000 Subject: Update libregexp with recent bug fixes from Plan 9. --- src/libregexp/rregexec.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/libregexp/rregexec.c') diff --git a/src/libregexp/rregexec.c b/src/libregexp/rregexec.c index e96c9721..eece0eb9 100644 --- a/src/libregexp/rregexec.c +++ b/src/libregexp/rregexec.c @@ -45,7 +45,7 @@ rregexec1(Reprog *progp, /* program to run */ switch(j->starttype) { case RUNE: while(*s != j->startchar) { - if(*s == 0) + if(*s == 0 || s == j->reol) return match; s++; } @@ -54,7 +54,7 @@ rregexec1(Reprog *progp, /* program to run */ if(s == bol) break; while(*s != '\n') { - if(*s == 0) + if(*s == 0 || s == j->reol) return match; s++; } @@ -72,7 +72,7 @@ rregexec1(Reprog *progp, /* program to run */ nl->inst = 0; /* Add first instruction to current list */ - _rrenewemptythread(tl, progp->startinst, s); + _rrenewemptythread(tl, progp->startinst, ms, s); /* Execute machine until current list is empty */ for(tlp=tl; tlp->inst; tlp++){ @@ -80,7 +80,7 @@ rregexec1(Reprog *progp, /* program to run */ switch(inst->type){ case RUNE: /* regular character */ if(inst->u1.r == r) - if(_renewthread(nl, inst->u2.next, &tlp->se)==nle) + if(_renewthread(nl, inst->u2.next, ms, &tlp->se)==nle) return -1; break; case LBRA: @@ -91,11 +91,11 @@ rregexec1(Reprog *progp, /* program to run */ continue; case ANY: if(r != '\n') - if(_renewthread(nl, inst->u2.next, &tlp->se)==nle) + if(_renewthread(nl, inst->u2.next, ms, &tlp->se)==nle) return -1; break; case ANYNL: - if(_renewthread(nl, inst->u2.next, &tlp->se)==nle) + if(_renewthread(nl, inst->u2.next, ms, &tlp->se)==nle) return -1; break; case BOL: @@ -110,7 +110,7 @@ rregexec1(Reprog *progp, /* program to run */ ep = inst->u1.cp->end; for(rp = inst->u1.cp->spans; rp < ep; rp += 2) if(r >= rp[0] && r <= rp[1]){ - if(_renewthread(nl, inst->u2.next, &tlp->se)==nle) + if(_renewthread(nl, inst->u2.next, ms, &tlp->se)==nle) return -1; break; } @@ -121,12 +121,12 @@ rregexec1(Reprog *progp, /* program to run */ if(r >= rp[0] && r <= rp[1]) break; if(rp == ep) - if(_renewthread(nl, inst->u2.next, &tlp->se)==nle) + if(_renewthread(nl, inst->u2.next, ms, &tlp->se)==nle) return -1; break; case OR: /* evaluate right choice later */ - if(_renewthread(tlp, inst->u1.right, &tlp->se) == tle) + if(_renewthread(tlp, inst->u1.right, ms, &tlp->se) == tle) return -1; /* efficiency: advance and re-evaluate */ continue; @@ -190,7 +190,7 @@ rregexec(Reprog *progp, /* program to run */ } j.starttype = 0; j.startchar = 0; - if(progp->startinst->type == RUNE && progp->startinst->u1.r < (Rune)Runeself) { + if(progp->startinst->type == RUNE && progp->startinst->u1.r < Runeself) { j.starttype = RUNE; j.startchar = progp->startinst->u1.r; } -- cgit v1.2.3