Skip to content
Snippets Groups Projects
Commit 2d425e657399 authored by Stewart Brodie's avatar Stewart Brodie
Browse files

Fix generate-id() to avoid generating the same ID

For nodes from different documents, especially for the document
node itself which would always get "idp0" as a result.
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=688171
parent 4d43dc02e369
No related branches found
No related tags found
No related merge requests found
......@@ -660,6 +660,7 @@
*/
void
xsltGenerateIdFunction(xmlXPathParserContextPtr ctxt, int nargs){
static char base_address;
xmlNodePtr cur = NULL;
xmlXPathObjectPtr obj = NULL;
long val;
......@@ -716,7 +717,7 @@
if (obj)
xmlXPathFreeObject(obj);
val = (long)((char *)cur - (char *)doc);
val = (long)((char *)cur - (char *)&base_address);
if (val >= 0) {
sprintf((char *)str, "idp%ld", val);
} else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment