Skip to content
Snippets Groups Projects
Commit 9182c276d0ae authored by William M. Brack's avatar William M. Brack
Browse files

fixed str:tokenize for case when 2nd argument is an empty string (should

* libexslt/strings.c: fixed str:tokenize for case when 2nd
  argument is an empty string (should produce a token for
  each char in the string).  Reported on the mailing list by
  Peter Pawlowski.
parent 93f30ee9aed9
No related branches found
No related tags found
No related merge requests found
Mon Jul 26 17:03:22 PDT 2004 William Brack <wbrack@mmm.com.hk>
* libexslt/strings.c: fixed str:tokenize for case when 2nd
argument is an empty string (should produce a token for
each char in the string). Reported on the mailing list by
Peter Pawlowski.
Fri Jul 23 21:55:14 PDT 2004 William Brack <wbrack@mmm.com.hk>
* libxslt/imports.c: further enhancement for template priorities
on imported stylesheets (better fix for bug 141279, fixes
......
......@@ -77,7 +77,17 @@
ret->boolval = 0; /* Freeing is not handled there anymore */
for (cur = str, token = str; *cur != 0; cur += clen) {
clen = xmlUTF8Size(cur);
for (delimiter = delimiters; *delimiter != 0;
if (*delimiters == 0) { /* empty string case */
xmlChar ctmp;
ctmp = *(cur+clen);
*(cur+clen) = 0;
node = xmlNewDocRawNode(container, NULL,
(const xmlChar *) "token", cur);
xmlAddChild((xmlNodePtr) container, node);
xmlXPathNodeSetAddUnique(ret->nodesetval, node);
*(cur+clen) = ctmp; /* restore the changed byte */
token = cur + clen;
} else for (delimiter = delimiters; *delimiter != 0;
delimiter += xmlUTF8Size(delimiter)) {
if (!xmlUTF8Charcmp(cur, delimiter)) {
if (cur == token) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment