GNOME Bugzilla – Bug 793740
xmlTextReaderNextSibling() always returns -1
Last modified: 2021-07-05 13:24:56 UTC
Created attachment 368814 [details] [review] Patch to fix xmlTextReaderNextSibling() The function xmlTextReaderNextSibling() from xmlreader.c always returns -1 because it checks if reader->doc is NULL which is always true. If the check is inverted to reader->doc != NULL the function starts working correctly and returns 1 if there are siblings after the current reader node and 0 if there are none, which matches the function description. I've attached the fix as a patch and also added a PR on github: https://github.com/GNOME/libxml2/pull/13
Created attachment 372780 [details] [review] Patch to support xmlReaderNextSibling without preparsed document I noticed that my previous patch was broken in two cases: * The reader was built on a preparsed document (eg. using xmlReaderWalker(doc)) * The reader was not yet on a node (before the first call to xmlReaderRead(reader)) The updated patch addresses these cases.
Re-submitted the issue and patch as a merge request on GitLab: * https://gitlab.gnome.org/GNOME/libxml2/issues/7 * https://gitlab.gnome.org/GNOME/libxml2/merge_requests/2
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new ticket at https://gitlab.gnome.org/GNOME/libxml2/-/issues/ Thank you for your understanding and your help.