diff options
author | Daniel Veillard <veillard@src.gnome.org> | 2005-11-01 15:24:02 +0000 |
---|---|---|
committer | Daniel Veillard <veillard@src.gnome.org> | 2005-11-01 15:24:02 +0000 |
commit | fc6eca0d8196f200da4bf4083b0d9dbc7079460a (patch) | |
tree | 44ca31c3e7c94fe583171ff146aaf5ab1e3735a4 /xmlregexp.c | |
parent | 3d6aa10d8ce08d9ec71670df44e59057031081ca (diff) | |
download | android_external_libxml2-fc6eca0d8196f200da4bf4083b0d9dbc7079460a.tar.gz android_external_libxml2-fc6eca0d8196f200da4bf4083b0d9dbc7079460a.tar.bz2 android_external_libxml2-fc6eca0d8196f200da4bf4083b0d9dbc7079460a.zip |
fix bug #319897, problem with counted atoms when the transition itself is
* xmlregexp.c: fix bug #319897, problem with counted atoms
when the transition itself is counted too
* result/regexp/hard test/regexp/hard: augmented the regression
tests with the problem exposed.
Daniel
Diffstat (limited to 'xmlregexp.c')
-rw-r--r-- | xmlregexp.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/xmlregexp.c b/xmlregexp.c index fe028226..fce1f1d1 100644 --- a/xmlregexp.c +++ b/xmlregexp.c @@ -2812,7 +2812,15 @@ xmlFARegExec(xmlRegexpPtr comp, const xmlChar *content) { /* * this is a multiple input sequence + * If there is a counter associated increment it now. + * before potentially saving and rollback */ + if (trans->counter >= 0) { +#ifdef DEBUG_REGEXP_EXEC + printf("Increasing count %d\n", trans->counter); +#endif + exec->counts[trans->counter]++; + } if (exec->state->nbTrans > exec->transno + 1) { xmlFARegExecSave(exec); } @@ -2862,6 +2870,12 @@ xmlFARegExec(xmlRegexpPtr comp, const xmlChar *content) { if (ret == 0) { goto rollback; } + if (trans->counter >= 0) { +#ifdef DEBUG_REGEXP_EXEC + printf("Decreasing count %d\n", trans->counter); +#endif + exec->counts[trans->counter]--; + } } else if ((ret == 0) && (atom->min == 0) && (atom->max > 0)) { /* * we don't match on the codepoint, but minOccurs of 0 |