diff options
author | hobbs <hobbs> | 1999-11-02 02:09:47 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 1999-11-02 02:09:47 (GMT) |
commit | 9e26d55149be989cf854b334f6063957900dbb7e (patch) | |
tree | 323c2a991fd63005e53e1f59d0171bf9d98f417b /generic/regc_cvec.c | |
parent | b6a5656b86e4002c709159404e14acd2e41493e7 (diff) | |
download | tcl-9e26d55149be989cf854b334f6063957900dbb7e.zip tcl-9e26d55149be989cf854b334f6063957900dbb7e.tar.gz tcl-9e26d55149be989cf854b334f6063957900dbb7e.tar.bz2 |
* generic/regc_color.c:
* generic/regc_cvec.c:
* generic/regc_lex.c:
* generic/regc_locale.c:
* generic/regcomp.c:
* generic/regcustom.h:
* generic/regerrs.h:
* generic/regex.h:
* generic/regexec.c:
* generic/regguts.h:
* generic/tclRegexp.c:
* generic/tclTest.c:
* tests/reg.test: updated to Henry Spencer's new regexp engine
(mid-Sept 99). Should greatly reduce stack space reqs.
Diffstat (limited to 'generic/regc_cvec.c')
-rw-r--r-- | generic/regc_cvec.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/generic/regc_cvec.c b/generic/regc_cvec.c index 73ccc56..86765ea 100644 --- a/generic/regc_cvec.c +++ b/generic/regc_cvec.c @@ -110,8 +110,6 @@ pchr to; cv->nranges++; } -#ifdef NOTDEF /* This isn't used currently. */ - /* - addmcce - add an MCCE to a cvec ^ static VOID addmcce(struct cvec *, chr *, chr *); @@ -122,25 +120,26 @@ struct cvec *cv; chr *startp; /* beginning of text */ chr *endp; /* just past end of text */ { - int n = endp - startp; + int len; int i; chr *s; chr *d; - assert(n > 0); - assert(cv->nchrs + n < cv->chrspace - cv->nmccechrs); + if (startp == NULL && endp == NULL) + return; + len = endp - startp; + assert(len > 0); + assert(cv->nchrs + len < cv->chrspace - cv->nmccechrs); assert(cv->nmcces < cv->mccespace); - d = &cv->chrs[cv->chrspace - cv->nmccechrs - n - 1]; + d = &cv->chrs[cv->chrspace - cv->nmccechrs - len - 1]; cv->mcces[cv->nmcces++] = d; - for (s = startp, i = n; i > 0; s++, i--) + for (s = startp, i = len; i > 0; s++, i--) *d++ = *s; *d++ = 0; /* endmarker */ assert(d == &cv->chrs[cv->chrspace - cv->nmccechrs]); - cv->nmccechrs += n + 1; + cv->nmccechrs += len + 1; } -#endif /* NOTDEF */ - /* - haschr - does a cvec contain this chr? ^ static int haschr(struct cvec *, pchr); |