diff options
author | dgp <dgp@users.sourceforge.net> | 2015-09-22 18:24:03 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2015-09-22 18:24:03 (GMT) |
commit | 01d74a0360b50ecd6012b945895691b7133eeb7c (patch) | |
tree | 1865dbe2a2110fd247bfdf0b7e69880db9749141 | |
parent | 5f52e1b2b7ff8feb89e357658503b2e85317a387 (diff) | |
parent | f0f0d2b1abf721e7cae3584cf4fc01cd5e0b9f66 (diff) | |
download | tcl-01d74a0360b50ecd6012b945895691b7133eeb7c.zip tcl-01d74a0360b50ecd6012b945895691b7133eeb7c.tar.gz tcl-01d74a0360b50ecd6012b945895691b7133eeb7c.tar.bz2 |
merge 8.5
-rw-r--r-- | generic/regc_color.c | 2 | ||||
-rw-r--r-- | generic/regcomp.c | 16 |
2 files changed, 10 insertions, 8 deletions
diff --git a/generic/regc_color.c b/generic/regc_color.c index 58de004..35e7904 100644 --- a/generic/regc_color.c +++ b/generic/regc_color.c @@ -259,7 +259,7 @@ newcolor( return COLORLESS; /* too many colors */ } n = cm->ncds * 2; - if (n < MAX_COLOR + 1) { + if (n > MAX_COLOR + 1) { n = MAX_COLOR + 1; } if (cm->cd == cm->cdspace) { diff --git a/generic/regcomp.c b/generic/regcomp.c index d23076b..b1c02d8 100644 --- a/generic/regcomp.c +++ b/generic/regcomp.c @@ -593,13 +593,15 @@ makesearch( break; } } + + /* + * We want to mark states as being in the list already by having non + * NULL tmp fields, but we can't just store the old slist value in tmp + * because that doesn't work for the first such state. Instead, the + * first list entry gets its own address in tmp. + */ if (b != NULL && s->tmp == NULL) { - /* - * Must be split if not already in the list (fixes bugs 505048, - * 230589, 840258, 504785). - */ - - s->tmp = slist; + s->tmp = (slist != NULL) ? slist : s; slist = s; } } @@ -620,7 +622,7 @@ makesearch( freearc(nfa, a); } } - s2 = s->tmp; + s2 = (s->tmp != s) ? s->tmp : NULL; s->tmp = NULL; /* clean up while we're at it */ } } |