diff options
author | hobbs <hobbs> | 1999-10-13 02:22:16 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 1999-10-13 02:22:16 (GMT) |
commit | 71fd2723b9468b0424d08077814238e4201c53d4 (patch) | |
tree | fd90266acf9550bec088e4be1aade4a25b3acfea /generic/regc_cvec.c | |
parent | 70325c9bcdba6fa60b67d70caadab8e46f08b677 (diff) | |
download | tcl-71fd2723b9468b0424d08077814238e4201c53d4.zip tcl-71fd2723b9468b0424d08077814238e4201c53d4.tar.gz tcl-71fd2723b9468b0424d08077814238e4201c53d4.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); |