Commit da8e5435 authored by Vladimir Bashkirtsev's avatar Vladimir Bashkirtsev

Updated libxml2 to 2.9.9

parent 946fad44
all: all:
tar xf libxml2-2.9.8.tar.gz tar xf libxml2-2.9.9.tar.gz
patch -Np1 -d libxml2-2.9.8 < libxml2-2.9.8-python3_hack-1.patch cd libxml2-2.9.9 && sed -i '/_PyVerify_fd/,+1d' python/types.c
cd libxml2-2.9.8 && sed -i '/_PyVerify_fd/,+1d' python/types.c cd libxml2-2.9.9 && ./configure --build=$(CLFS_TARGET) --prefix=/usr --disable-static --with-history --with-python=/usr/bin/python3 --with-threads
cd libxml2-2.9.8 && ./configure --build=$(CLFS_TARGET) --prefix=/usr --disable-static --with-history --with-python=/usr/bin/python3 --with-threads $(MAKE) -C libxml2-2.9.9
$(MAKE) -C libxml2-2.9.8 cd libxml2-2.9.9 && tar xf ../xmlts20130923.tar.gz
cd libxml2-2.9.8 && tar xf ../xmlts20130923.tar.gz
if [[ ! "$(BUILD_OPTIONS)" =~ no-tests ]] ; then \ if [[ ! "$(BUILD_OPTIONS)" =~ no-tests ]] ; then \
$(MAKE) -C libxml2-2.9.8 check ; \ $(MAKE) -C libxml2-2.9.9 check ; \
rm /missing.xml ; \ rm /missing.xml ; \
fi fi
$(MAKE) -C libxml2-2.9.8 install $(MAKE) -C libxml2-2.9.9 install
rm -rf libxml2-2.9.8 rm -rf libxml2-2.9.9
diff -uNr libxml2-2.9.8/python/libxml.c libxml2-2.9.8-python3_hack-1/python/libxml.c
--- libxml2-2.9.8/python/libxml.c 2016-06-07 19:34:14.000000000 +0930
+++ libxml2-2.9.8-python3_hack-1/python/libxml.c 2018-06-17 23:18:38.255187110 +0930
@@ -1620,6 +1620,7 @@
PyObject *message;
PyObject *result;
char str[1000];
+ unsigned char *ptr = (unsigned char *)str;
#ifdef DEBUG_ERROR
printf("libxml_xmlErrorFuncHandler(%p, %s, ...) called\n", ctx, msg);
@@ -1636,12 +1637,20 @@
str[999] = 0;
va_end(ap);
+#if PY_MAJOR_VERSION >= 3
+ /* Ensure the error string doesn't start at UTF8 continuation. */
+ while (*ptr && (*ptr & 0xc0) == 0x80)
+ ptr++;
+#endif
+
list = PyTuple_New(2);
PyTuple_SetItem(list, 0, libxml_xmlPythonErrorFuncCtxt);
Py_XINCREF(libxml_xmlPythonErrorFuncCtxt);
- message = libxml_charPtrConstWrap(str);
+ message = libxml_charPtrConstWrap(ptr);
PyTuple_SetItem(list, 1, message);
result = PyEval_CallObject(libxml_xmlPythonErrorFuncHandler, list);
+ /* Forget any errors caused in the error handler. */
+ PyErr_Clear();
Py_XDECREF(list);
Py_XDECREF(result);
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment