mirror of
https://github.com/termux/termux-packages.git
synced 2025-06-08 23:30:01 +00:00
Add polyfill implementation of `xmlShellPrintNode()` `libxml2` 2.14 has removed the function `xmlShellPrintNode()`, so this places a basic polyfill rewrite of it into the source code of `rdrview` 0.1.3 using code copied and pasted from the code that was removed from `libxml2`. tested with the command `rdrview -B firefox https://repology.org/maintainers/`, it appears to be working the same as it was with `libxml2` 2.13. Co-authored-by: Robert Kirkman <rkirkman@termux.dev>
39 lines
815 B
Diff
39 lines
815 B
Diff
polyfill copied and pasted from
|
|
https://github.com/GNOME/libxml2/commit/1341deac131af51bdd3b4dd124440c198d361cc9
|
|
since libxml2 2.14 removed xmlShellPrintNode()
|
|
|
|
--- a/src/rdrview.c
|
|
+++ b/src/rdrview.c
|
|
@@ -489,6 +489,31 @@ static void parse_arguments(int argc, char *argv[])
|
|
}
|
|
}
|
|
|
|
+
|
|
+/**
|
|
+ * xmlShellPrintNode:
|
|
+ * @node : a non-null node to print to the output FILE
|
|
+ *
|
|
+ * Print node to the output FILE
|
|
+ */
|
|
+
|
|
+static void xmlShellPrintNode(xmlNodePtr node)
|
|
+{
|
|
+ FILE *fp = stdout;
|
|
+
|
|
+ if (!node)
|
|
+ return;
|
|
+
|
|
+ if (node->type == XML_DOCUMENT_NODE)
|
|
+ xmlDocDump(fp, (xmlDocPtr) node);
|
|
+ else if (node->type == XML_ATTRIBUTE_NODE)
|
|
+ xmlDebugDumpAttrList(fp, (xmlAttrPtr) node, 0);
|
|
+ else
|
|
+ xmlElemDump(fp, node->doc, node);
|
|
+
|
|
+ fprintf(fp, "\n");
|
|
+}
|
|
+
|
|
/**
|
|
* Save the HTML for a node to the given file
|
|
*/
|