diff options
| author | rsc <devnull@localhost> | 2004-03-05 05:13:56 +0000 |
|---|---|---|
| committer | rsc <devnull@localhost> | 2004-03-05 05:13:56 +0000 |
| commit | 62390091b7ff715e9336cc69a3ee41a6c458221e (patch) | |
| tree | 352da5cb2dce3e3310f6c8324ec79c326d13200a /src/libregexp/rregexec.c | |
| parent | 4da83e7ccebd8ab6eb33747d16292567ec59d7dd (diff) | |
| download | plan9port-62390091b7ff715e9336cc69a3ee41a6c458221e.tar.gz plan9port-62390091b7ff715e9336cc69a3ee41a6c458221e.zip | |
Update libregexp with recent bug fixes from Plan 9.
Diffstat (limited to 'src/libregexp/rregexec.c')
| -rw-r--r-- | src/libregexp/rregexec.c | 20 |
1 files changed, 10 insertions, 10 deletions
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; } |
