aboutsummaryrefslogtreecommitdiff
path: root/jimregexp.c
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2011-06-14 10:42:55 +1000
committerSteve Bennett <steveb@workware.net.au>2011-07-07 21:34:34 +1000
commitd72dac96e1e6fba8153b5c38c698b0fe487b939f (patch)
tree72a8bb71af2f4909c39e7b5aac6f9cfdce64bb91 /jimregexp.c
parente6eebd6b8822ce954a864cb3b02799b53ec7fec3 (diff)
downloadjimtcl-d72dac96e1e6fba8153b5c38c698b0fe487b939f.zip
jimtcl-d72dac96e1e6fba8153b5c38c698b0fe487b939f.tar.gz
jimtcl-d72dac96e1e6fba8153b5c38c698b0fe487b939f.tar.bz2
Minor code cleanups
Some unused variables Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'jimregexp.c')
-rw-r--r--jimregexp.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/jimregexp.c b/jimregexp.c
index 141db92..b138cb1 100644
--- a/jimregexp.c
+++ b/jimregexp.c
@@ -1269,14 +1269,11 @@ static int regmatchsimplerepeat(regex_t *preg, int scan, int matchmin)
static int regmatchrepeat(regex_t *preg, int scan, int matchmin)
{
- const char *save;
int *scanpt = preg->program + scan;
int max = scanpt[2];
int min = scanpt[3];
- save = preg->reginput;
-
/* Have we reached min? */
if (scanpt[4] < min) {
/* No, so get another one */
@@ -1305,7 +1302,6 @@ static int regmatchrepeat(regex_t *preg, int scan, int matchmin)
return 0;
}
/* maximal, so try this branch again */
- save = preg->reginput;
if (scanpt[4] < max) {
scanpt[4]++;
if (regmatch(preg, scan + 5)) {
@@ -1313,10 +1309,8 @@ static int regmatchrepeat(regex_t *preg, int scan, int matchmin)
}
scanpt[4]--;
}
- /* At this point we are at max with no match. Back up by one and try the other branch */
- preg->reginput = save;
- int ret = regmatch(preg, regnext(preg, scan));
- return ret;
+ /* At this point we are at max with no match. Try the other branch */
+ return regmatch(preg, regnext(preg, scan));
}
/*