diff options
-rw-r--r-- | src/libregexp/regexec.c | 2 | ||||
-rw-r--r-- | src/libregexp/rregexec.c | 1 | ||||
-rw-r--r-- | src/libregexp/rregsub.c | 7 |
3 files changed, 4 insertions, 6 deletions
diff --git a/src/libregexp/regexec.c b/src/libregexp/regexec.c index a00fbcbc..b75f17fa 100644 --- a/src/libregexp/regexec.c +++ b/src/libregexp/regexec.c @@ -171,7 +171,7 @@ regexec2(Reprog *progp, /* program to run */ return -1; relist1 = malloc(BIGLISTSIZE*sizeof(Relist)); if(relist1 == nil){ - free(relist1); + free(relist0); return -1; } j->relist[0] = relist0; diff --git a/src/libregexp/rregexec.c b/src/libregexp/rregexec.c index c3a1753b..ca48a31d 100644 --- a/src/libregexp/rregexec.c +++ b/src/libregexp/rregexec.c @@ -40,7 +40,6 @@ rregexec1(Reprog *progp, /* program to run */ /* Execute machine once for each character, including terminal NUL */ s = j->rstarts; do{ - /* fast check for first char */ if(checkstart) { switch(j->starttype) { diff --git a/src/libregexp/rregsub.c b/src/libregexp/rregsub.c index 5a4a564d..8b3e9738 100644 --- a/src/libregexp/rregsub.c +++ b/src/libregexp/rregsub.c @@ -27,7 +27,7 @@ rregsub(Rune *sp, /* source string */ case '8': case '9': i = *sp-'0'; - if(mp[i].s.rsp != 0 && mp!=0 && ms>i) + if(mp!=0 && mp[i].s.rsp != 0 && ms>i) for(ssp = mp[i].s.rsp; ssp < mp[i].e.rep; ssp++) @@ -46,9 +46,8 @@ rregsub(Rune *sp, /* source string */ *dp++ = *sp; break; } - }else if(*sp == '&'){ - if(mp[0].s.rsp != 0 && mp!=0 && ms>0) - if(mp[0].s.rsp != 0) + }else if(*sp == '&'){ + if(mp!=0 && mp[0].s.rsp != 0 && ms>0) for(ssp = mp[0].s.rsp; ssp < mp[0].e.rep; ssp++) if(dp < ep) |