aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Allaert <patrickallaert@php.net>2021-11-04 18:36:05 +0100
committerAriadne Conill <ariadne@dereferenced.org>2021-11-05 14:06:19 +0000
commitde8bce08376a189ad14809d0272bb4c02e74cdf0 (patch)
tree15d13b29aca037c2a9fd3643afebd02727d99f0b
parent9cd74563762eaa03aba787b87d9fb1f8476ceb76 (diff)
downloadaports-de8bce08376a189ad14809d0272bb4c02e74cdf0.tar.gz
aports-de8bce08376a189ad14809d0272bb4c02e74cdf0.tar.bz2
aports-de8bce08376a189ad14809d0272bb4c02e74cdf0.tar.xz
main/libxml2: Fix upstream issue 266
https://gitlab.gnome.org/GNOME/libxml2/-/issues/266
-rw-r--r--main/libxml2/APKBUILD4
-rw-r--r--main/libxml2/whitespace-when-serializing-empty-html-documents.patch43
2 files changed, 46 insertions, 1 deletions
diff --git a/main/libxml2/APKBUILD b/main/libxml2/APKBUILD
index 366847e269..c7f1da8cb1 100644
--- a/main/libxml2/APKBUILD
+++ b/main/libxml2/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: Carlo Landmeter <clandmeter@alpinelinux.org>
pkgname=libxml2
pkgver=2.9.12
-pkgrel=1
+pkgrel=2
pkgdesc="XML parsing library, version 2"
url="http://www.xmlsoft.org/"
arch="all"
@@ -21,6 +21,7 @@ source="http://xmlsoft.org/sources/libxml2-$pkgver.tar.gz
revert-Make-xmlFreeNodeList-non-recursive.patch
libxml2-2.9.8-python3-unicode-errors.patch
work-around-lxml-api-abuse.patch
+ whitespace-when-serializing-empty-html-documents.patch
"
# secfixes:
@@ -108,4 +109,5 @@ df1c6486e80f0fcf3c506f3599bcfb94b620c00d0b5d26831bc983daa78d58ec58b5057b1ec7c1a2
347178e432379d543683cba21b902e7305202c03e8dbd724ae395963d677096a5cfc4e345e208d498163ca5174683c167610fc2b297090476038bc2bb7c84b4f revert-Make-xmlFreeNodeList-non-recursive.patch
a205c97fa1488fb8907cfa08b5f82e2055c80b86213dc3cc5c4b526fe6aa786bcc4e4eeb226c44635a1d021307b39e3940f706c42fb60e9e3e9b490a84164df7 libxml2-2.9.8-python3-unicode-errors.patch
5e2a80038cb7085fce27dfff2d92f651259124b1a899ce3b5dbb0f6f8e815e30d5256e447cd1dff227f535be0c13ce8cff0234cf0bee7ff75cd2245a8b65130a work-around-lxml-api-abuse.patch
+c8dab6cf3556f7ee73da7dd57d07b567c248371bee25679c8f98c2f599c45e0a6fc476d5f3fe4bb40a3b735d9b35fbc4b1da0506d0f16a17c71644ead2204beb whitespace-when-serializing-empty-html-documents.patch
"
diff --git a/main/libxml2/whitespace-when-serializing-empty-html-documents.patch b/main/libxml2/whitespace-when-serializing-empty-html-documents.patch
new file mode 100644
index 0000000000..81fc243435
--- /dev/null
+++ b/main/libxml2/whitespace-when-serializing-empty-html-documents.patch
@@ -0,0 +1,43 @@
+From 92d9ab4c28842a09ca2b76d3ff2f933e01b6cd6f Mon Sep 17 00:00:00 2001
+From: Nick Wellnhofer <wellnhofer@aevum.de>
+Date: Mon, 7 Jun 2021 15:09:53 +0200
+Subject: [PATCH] Fix whitespace when serializing empty HTML documents
+
+The old, non-recursive HTML serialization code would always terminate
+the output with a newline. The new implementation omitted the newline
+if the document node had no children. Readd the newline when
+serializing empty documents.
+
+Fixes #266.
+---
+ HTMLtree.c | 14 +++++++++-----
+ 1 file changed, 9 insertions(+), 5 deletions(-)
+
+diff --git a/HTMLtree.c b/HTMLtree.c
+index bdd639c7..7a2b8558 100644
+--- a/HTMLtree.c
++++ b/HTMLtree.c
+@@ -763,11 +763,15 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
+ if (((xmlDocPtr) cur)->intSubset != NULL) {
+ htmlDtdDumpOutput(buf, (xmlDocPtr) cur, NULL);
+ }
+- /* Always validate cur->parent when descending. */
+- if ((cur->parent == parent) && (cur->children != NULL)) {
+- parent = cur;
+- cur = cur->children;
+- continue;
++ if (cur->children != NULL) {
++ /* Always validate cur->parent when descending. */
++ if (cur->parent == parent) {
++ parent = cur;
++ cur = cur->children;
++ continue;
++ }
++ } else {
++ xmlOutputBufferWriteString(buf, "\n");
+ }
+ break;
+
+--
+GitLab
+