From e3cd2eacdd9937c22616ced914918eb75c6cfb7c Mon Sep 17 00:00:00 2001 From: ketmar Date: Fri, 23 Aug 2013 13:16:09 +0300 Subject: [PATCH] fixed cosmetic bug --- src/libre9/re9.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/libre9/re9.c b/src/libre9/re9.c index ba3bd6a..599e7b8 100644 --- a/src/libre9/re9.c +++ b/src/libre9/re9.c @@ -1241,7 +1241,7 @@ typedef struct { int listsize; int starttype; re9_rune startchar; - const char *starts; + const char *bol; const char *eol; int flags; } re9_ljunk_t; @@ -1347,7 +1347,7 @@ static inline int is_word_rune (re9_rune r) { * ms: number of elements at mp * j */ -static int regexec1 (const re9_prog_t *progp, const char *bol, re9_sub_t *mp, int ms, re9_ljunk_t *j) { +static int regexec1 (const re9_prog_t *progp, re9_sub_t *mp, int ms, re9_ljunk_t *j) { int flag = 0; #ifdef RE9_CALC_MAXT int maxt = 0; @@ -1377,7 +1377,7 @@ static int regexec1 (const re9_prog_t *progp, const char *bol, re9_sub_t *mp, in j->relistf[0] = j->relist[0]; j->relistf[1] = j->relist[1]; /* execute machine once for each character, including terminal NUL */ - s = j->starts; + s = j->bol; rprev = RE9_RUNE_MAX+1; for (;;) { /* fast check for first char */ @@ -1413,7 +1413,7 @@ static int regexec1 (const re9_prog_t *progp, const char *bol, re9_sub_t *mp, in rprev = (p == s ? RE9_RUNE_MAX+1 : s[-1]); /*FIXME: previous rune can be UTF-8 one*/ break; case BOL: - if (s == bol) break; + if (s == j->bol) break; if (s == j->eol) goto mt_quit; p = memchr(s, '\n', j->eol-s); if (p == NULL || p+1 >= j->eol) goto mt_quit; @@ -1489,7 +1489,7 @@ static int regexec1 (const re9_prog_t *progp, const char *bol, re9_sub_t *mp, in if (re9l_newthread(&nl, op->next, ms, &tlp->se, dont_collapse) == NULL) return -1; break; case BOL: - if (s == bol || rprev == RE9_RUNE_MAX+1 || rprev == '\n') continue; + if (s == j->bol || rprev == RE9_RUNE_MAX+1 || rprev == '\n') continue; break; case EOL: if (s == j->eol || r == '\n') continue; @@ -1539,7 +1539,7 @@ static int regexec1 (const re9_prog_t *progp, const char *bol, re9_sub_t *mp, in match = 1; tlp->se.m[0].ep = s; if (mp != 0) re9l_newmatch(mp, ms, &tlp->se); - dlogf("HIT at %u! (%d,%d) (%s)\n", tlp-tl.start, tlp->se.m[0].sp-bol, tlp->se.m[0].ep-bol, (tlp < tlxn ? "old" : "new")); + dlogf("HIT at %u! (%d,%d) (%s)\n", tlp-tl.start, tlp->se.m[0].sp-j->bol, tlp->se.m[0].ep-j->bol, (tlp < tlxn ? "old" : "new")); #ifndef RE9_DISABLE_NONGREEDY if (flags&RE9_FLAG_NONGREEDY) { /* fuck off all 'old' instructions */ @@ -1582,10 +1582,10 @@ static int re9_exec_internal (const re9_prog_t *progp, int flags, const char *bo re9_ljunk_t j; /* use user-specified starting/ending location if specified */ if ((flags&RE9_FLAG_MT0_RANGE) && mp != NULL) { - j.starts = (mp->sp != NULL ? mp->sp : bol); - j.eol = (mp->ep != NULL ? mp->ep : j.starts+strlen(j.starts)); + j.bol = (mp->sp != NULL ? mp->sp : bol); + j.eol = (mp->ep != NULL ? mp->ep : j.bol+strlen(j.bol)); } else { - j.eol = (j.starts = bol)+strlen(bol); + j.eol = (j.bol = bol)+strlen(bol); } j.flags = flags; j.startchar = 0; @@ -1601,7 +1601,7 @@ static int re9_exec_internal (const re9_prog_t *progp, int flags, const char *bo j.listsize = listsz; j.relist[0] = rl0; j.relist[1] = rl1; - return regexec1(progp, bol, mp, ms, &j); + return regexec1(progp, mp, ms, &j); } -- 2.11.4.GIT