Imported Upstream version 1.1.37 upstream/1.1.37
authorDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 13 Sep 2022 02:22:42 +0000 (11:22 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 13 Sep 2022 02:22:42 +0000 (11:22 +0900)
16 files changed:
.gitlab-ci.yml
Makefile.am
NEWS
configure.ac
libexslt/Makefile.am
libxslt/Makefile.am
libxslt/functions.c
libxslt/keys.c
libxslt/numbers.c
libxslt/pattern.c
libxslt/transform.c
python/Makefile.am
python/libxslt.c
tests/fuzz/Makefile.am
xslt-config.in
xsltproc/Makefile.am

index 2ca5355..d4af61c 100644 (file)
@@ -27,7 +27,8 @@ gcc:
 gcc:python3:
   extends: .test
   variables:
-    CFLAGS: "-O2"
+    # TODO: Re-enable the warning after libxml2 #208 is fixed.
+    CFLAGS: "-O2 -Wno-error=deprecated-declarations"
     PYTHON: "/usr/bin/python3"
 
 gcc:static:
index d5d6a4c..a2d766f 100644 (file)
@@ -12,17 +12,15 @@ confexec_DATA = xsltConf.sh
 
 bin_SCRIPTS = xslt-config
 
-dist-hook: cleanup libxslt.spec
+dist-hook: cleanup
        touch $(distdir)/doc/*.xml
        touch $(distdir)/doc/EXSLT/*.xml
        touch $(distdir)/libxslt/*.syms
        (cd $(srcdir) ; tar -cf - win32 vms examples) | (cd $(distdir); tar xf -)
 
-EXTRA_DIST = xsltConf.sh.in xslt-config.in libxslt.spec libxslt.spec.in \
-             FEATURES TODO Copyright libxslt.m4 \
-            win32/libxslt/libxslt.def win32/libxslt/libxslt.dsw \
-            win32/libxslt/libxslt_so.dsp win32/libxslt/xsltproc.dsp \
-            CMakeLists.txt config.h.cmake.in FindGcrypt.cmake libxslt-config.cmake.in libxslt-config.cmake.cmake.in
+EXTRA_DIST = xsltConf.sh.in \
+             FEATURES TODO Copyright \
+            CMakeLists.txt config.h.cmake.in libxslt-config.cmake.in libxslt-config.cmake.cmake.in
 
 ## We create xsltConf.sh here and not from configure because we want
 ## to get the paths expanded correctly.  Macros like srcdir are given
@@ -73,8 +71,9 @@ pkgconfigdir=$(libdir)/pkgconfig
 pkgconfig_DATA = libxslt.pc libexslt.pc
 
 cmakedir = $(libdir)/cmake/libxslt
-cmake_DATA = FindGcrypt.cmake libxslt-config.cmake
+dist_cmake_DATA = FindGcrypt.cmake
+cmake_DATA = libxslt-config.cmake
 
 m4datadir = $(datadir)/aclocal
-m4data_DATA = libxslt.m4
+dist_m4data_DATA = libxslt.m4
 
diff --git a/NEWS b/NEWS
index 0f2dcd7..dc97c2c 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,19 @@
 NEWS file for libxslt
 
+v1.1.37: Aug 29 2022
+
+### Improvements
+
+- Don't use deprecated libxml2 macros
+- Don't mess with xmlDefaultSAXHandler
+
+### Build system
+
+- Require automake-1.16.3 or later
+- Remove generated files from distribution
+- Add missing compile definition for static builds to Autotools (Mike Dalessio)
+
+
 v1.1.36: Aug 17 2022
 
 ### Removals and deprecations
index 3cb0f64..baeee60 100644 (file)
@@ -3,7 +3,7 @@ AC_PREREQ(2.63)
 
 m4_define([MAJOR_VERSION], [1])
 m4_define([MINOR_VERSION], [1])
-m4_define([MICRO_VERSION], [36])
+m4_define([MICRO_VERSION], [37])
 
 AC_INIT([libxslt], [MAJOR_VERSION.MINOR_VERSION.MICRO_VERSION])
 AC_CONFIG_SRCDIR([libxslt/xslt.c])
@@ -67,7 +67,7 @@ AC_SUBST(LIBEXSLT_VERSION_INFO)
 AC_SUBST(LIBEXSLT_VERSION_NUMBER)
 AC_SUBST(LIBEXSLT_VERSION_EXTRA)
 
-AM_INIT_AUTOMAKE([1.15 foreign no-dist-gzip dist-xz])
+AM_INIT_AUTOMAKE([1.16.3 foreign no-dist-gzip dist-xz])
 AM_MAINTAINER_MODE([enable])
 AM_SILENT_RULES([yes])
 
@@ -505,6 +505,21 @@ AC_SUBST(XSLT_INCLUDEDIR)
 AC_SUBST(XSLT_LIBS)
 AC_SUBST(XSLT_PRIVATE_LIBS)
 
+LIBXSLT_CFLAGS=""
+case ${host} in
+    *-*-mingw* | *-*-cygwin* | *-*-msvc* )
+        # If the host is Windows, and shared libraries are disabled, we
+        # need to add -DLIBXML_STATIC to EXTRA_CFLAGS in order for linking to
+        # work properly (without it, xmlexports.h would force the use of
+        # DLL imports, which obviously aren't present in a static
+        # library).
+        if test "x$enable_shared" = "xno"; then
+           LIBXSLT_CFLAGS="$LIBXSLT_CFLAGS -DLIBXSLT_STATIC -DLIBEXSLT_STATIC"
+        fi
+        ;;
+esac
+AC_SUBST(LIBXSLT_CFLAGS)
+
 EXSLT_LIBDIR='-L${libdir}'
 EXSLT_INCLUDEDIR='-I${includedir}'
 EXSLT_PRIVATE_LIBS="$XSLT_PRIVATE_LIBS $LIBGCRYPT_LIBS"
index 46d4371..c2dc636 100644 (file)
@@ -2,7 +2,7 @@ AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/libxslt -I$(top_srcdir)/libexslt \
              -I$(top_builddir) -I$(top_builddir)/libxslt \
              -I$(top_builddir)/libexslt
 
-AM_CFLAGS = $(LIBGCRYPT_CFLAGS) $(LIBXML_CFLAGS)
+AM_CFLAGS = $(LIBGCRYPT_CFLAGS) $(LIBXML_CFLAGS) $(LIBXSLT_CFLAGS)
 
 lib_LTLIBRARIES = libexslt.la
 
index 4b131d5..9560dc3 100644 (file)
@@ -1,6 +1,6 @@
 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/libxslt
 
-AM_CFLAGS = $(LIBXML_CFLAGS)
+AM_CFLAGS = $(LIBXML_CFLAGS) $(LIBXSLT_CFLAGS)
 
 lib_LTLIBRARIES = libxslt.la
 
index fa8b6d9..ed2b002 100644 (file)
@@ -608,7 +608,8 @@ xsltFormatNumberFunction(xmlXPathParserContextPtr ctxt, int nargs)
 
     switch (nargs) {
     case 3:
-       CAST_TO_STRING;
+        if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))
+            xmlXPathStringFunction(ctxt, 1);
        decimalObj = valuePop(ctxt);
         ncname = xsltSplitQName(sheet->dict, decimalObj->stringval, &prefix);
         if (prefix != NULL) {
@@ -634,13 +635,16 @@ xsltFormatNumberFunction(xmlXPathParserContextPtr ctxt, int nargs)
        }
        /* Intentional fall-through */
     case 2:
-       CAST_TO_STRING;
+        if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))
+            xmlXPathStringFunction(ctxt, 1);
        formatObj = valuePop(ctxt);
-       CAST_TO_NUMBER;
+        if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))
+            xmlXPathNumberFunction(ctxt, 1);
        numberObj = valuePop(ctxt);
        break;
     default:
-       XP_ERROR(XPATH_INVALID_ARITY);
+       xmlXPathErr(ctxt, XPATH_INVALID_ARITY);
+        return;
     }
 
     if (formatValues != NULL) {
index ecef538..ca0779c 100644 (file)
@@ -310,7 +310,7 @@ xsltAddKey(xsltStylesheetPtr style, const xmlChar *name,
     current = end = 0;
     while (match[current] != 0) {
        start = current;
-       while (IS_BLANK_CH(match[current]))
+       while (xmlIsBlank_ch(match[current]))
            current++;
        end = current;
        while ((match[end] != 0) && (match[end] != '|')) {
index 4cb2125..9c74f0d 100644 (file)
@@ -92,6 +92,12 @@ xsltUTF8Charcmp(xmlChar *utf1, xmlChar *utf2) {
     return xmlStrncmp(utf1, utf2, len);
 }
 
+static int
+xsltIsLetterDigit(int val) {
+    return xmlIsBaseCharQ(val) || xmlIsIdeographicQ(val) ||
+           xmlIsDigitQ(val);
+}
+
 /***** Stop temp insert *****/
 /************************************************************************
  *                                                                     *
@@ -347,8 +353,8 @@ xsltNumberFormatTokenize(const xmlChar *format,
      * Insert initial non-alphanumeric token.
      * There is always such a token in the list, even if NULL
      */
-    while (! (IS_LETTER(val=xmlStringCurrentChar(NULL, format+ix, &len)) ||
-             IS_DIGIT(val)) ) {
+    while (!xsltIsLetterDigit(val = xmlStringCurrentChar(NULL, format+ix,
+                                                         &len))) {
        if (format[ix] == 0)            /* if end of format string */
            break; /* while */
        ix += len;
@@ -414,7 +420,7 @@ xsltNumberFormatTokenize(const xmlChar *format,
         * to correspond to the Letter and Digit classes from XML (and
         * one wonders why XSLT doesn't refer to these instead).
         */
-       while (IS_LETTER(val) || IS_DIGIT(val)) {
+       while (xsltIsLetterDigit(val)) {
            ix += len;
            val = xmlStringCurrentChar(NULL, format+ix, &len);
        }
@@ -423,7 +429,7 @@ xsltNumberFormatTokenize(const xmlChar *format,
         * Insert temporary non-alphanumeric final tooken.
         */
        j = ix;
-       while (! (IS_LETTER(val) || IS_DIGIT(val))) {
+       while (!xsltIsLetterDigit(val)) {
            if (val == 0)
                break; /* while */
            ix += len;
index 1944661..da3444f 100644 (file)
@@ -1192,7 +1192,7 @@ xsltCompMatchClearCache(xsltTransformContextPtr ctxt, xsltCompMatchPtr comp) {
 #define CUR_PTR ctxt->cur
 
 #define SKIP_BLANKS                                                    \
-    while (IS_BLANK_CH(CUR)) NEXT
+    while (xmlIsBlank_ch(CUR)) NEXT
 
 #define CURRENT (*ctxt->cur)
 #define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
@@ -1235,11 +1235,11 @@ xsltScanLiteral(xsltParserContextPtr ctxt) {
         NEXT;
        cur = q = CUR_PTR;
        val = xmlStringCurrentChar(NULL, cur, &len);
-       while ((IS_CHAR(val)) && (val != '"')) {
+       while ((xmlIsCharQ(val)) && (val != '"')) {
            cur += len;
            val = xmlStringCurrentChar(NULL, cur, &len);
        }
-       if (!IS_CHAR(val)) {
+       if (!xmlIsCharQ(val)) {
            ctxt->error = 1;
            return(NULL);
        } else {
@@ -1251,11 +1251,11 @@ xsltScanLiteral(xsltParserContextPtr ctxt) {
         NEXT;
        cur = q = CUR_PTR;
        val = xmlStringCurrentChar(NULL, cur, &len);
-       while ((IS_CHAR(val)) && (val != '\'')) {
+       while ((xmlIsCharQ(val)) && (val != '\'')) {
            cur += len;
            val = xmlStringCurrentChar(NULL, cur, &len);
        }
-       if (!IS_CHAR(val)) {
+       if (!xmlIsCharQ(val)) {
            ctxt->error = 1;
            return(NULL);
        } else {
@@ -1264,7 +1264,6 @@ xsltScanLiteral(xsltParserContextPtr ctxt) {
        cur += len;
        CUR_PTR = cur;
     } else {
-       /* XP_ERROR(XPATH_START_LITERAL_ERROR); */
        ctxt->error = 1;
        return(NULL);
     }
@@ -1290,14 +1289,15 @@ xsltScanNCName(xsltParserContextPtr ctxt) {
 
     cur = q = CUR_PTR;
     val = xmlStringCurrentChar(NULL, cur, &len);
-    if (!IS_LETTER(val) && (val != '_'))
+    if (!xmlIsBaseCharQ(val) && !xmlIsIdeographicQ(val) && (val != '_'))
        return(NULL);
 
-    while ((IS_LETTER(val)) || (IS_DIGIT(val)) ||
+    while (xmlIsBaseCharQ(val) || xmlIsIdeographicQ(val) ||
+           xmlIsDigitQ(val) ||
            (val == '.') || (val == '-') ||
           (val == '_') ||
-          (IS_COMBINING(val)) ||
-          (IS_EXTENDER(val))) {
+          xmlIsCombiningQ(val) ||
+          xmlIsExtenderQ(val)) {
        cur += len;
        val = xmlStringCurrentChar(NULL, cur, &len);
     }
@@ -1853,7 +1853,7 @@ xsltCompilePatternInternal(const xmlChar *pattern, xmlDocPtr doc,
     current = end = 0;
     while (pattern[current] != 0) {
        start = current;
-       while (IS_BLANK_CH(pattern[current]))
+       while (xmlIsBlank_ch(pattern[current]))
            current++;
        end = current;
        level = 0;
index 2d8fd7f..cb43bb4 100644 (file)
@@ -3637,12 +3637,12 @@ xsltDocumentElem(xsltTransformContextPtr ctxt, xmlNodePtr node,
 
        element = elements;
        while (*element != 0) {
-           while (IS_BLANK_CH(*element))
+           while (xmlIsBlank_ch(*element))
                element++;
            if (*element == 0)
                break;
            end = element;
-           while ((*end != 0) && (!IS_BLANK_CH(*end)))
+           while ((*end != 0) && (!xmlIsBlank_ch(*end)))
                end++;
            element = xmlStrndup(element, end - element);
            if (element) {
index 24ede9c..fa7ed00 100644 (file)
@@ -19,7 +19,7 @@ libxsltmod_la_CPPFLAGS = \
        -I$(top_srcdir)/libxslt \
        -I$(top_srcdir) \
        -I../libexslt \
-       $(PYTHON_CFLAGS) $(LIBXML_CFLAGS)
+       $(PYTHON_CFLAGS) $(LIBXML_CFLAGS) $(LIBXSLT_CFLAGS)
 libxsltmod_la_SOURCES = libxslt.c types.c
 nodist_libxsltmod_la_SOURCES = libxslt-py.c
 libxsltmod_la_LIBADD = \
@@ -31,7 +31,7 @@ libxsltmod_la_LDFLAGS = -module -avoid-version
 libxslt.py: $(srcdir)/libxsl.py libxsltclass.py
        cat $(srcdir)/libxsl.py libxsltclass.py > $@
 
-python_PYTHON = libxslt.py
+nodist_python_PYTHON = libxslt.py
 
 GENERATE = generator.py
 API_DESC = $(top_srcdir)/doc/libxslt-api.xml $(srcdir)/libxslt-python-api.xml
@@ -57,4 +57,7 @@ endif
 tests test: all
        cd tests && $(MAKE) tests
 
-CLEANFILES = $(GENERATED) *.o libxslt.so *.pyc libxslt.py gen_prog
+CLEANFILES = $(GENERATED) *.pyc libxslt.py gen_prog
+
+clean-local:
+       rm -rf __pycache__
index 353939e..0758d60 100644 (file)
@@ -1280,7 +1280,6 @@ void initlibxsltmod(void) {
      */
     libxslt_xsltErrorInitialize();
     xmlLoadExtDtdDefaultValue = XML_DETECT_IDS | XML_COMPLETE_ATTRS;
-    xmlDefaultSAXHandler.cdataBlock = NULL;
     /*
      * Register the EXSLT extensions and the test module
      */
index 7e22bd9..5f4d90b 100644 (file)
@@ -6,7 +6,7 @@ check_PROGRAMS = testTargets
 EXTRA_DIST = xpath.dict xpath.xml xslt.dict xslt.xml seed
 CLEANFILES = $(EXTRA_PROGRAMS)
 AM_CPPFLAGS = -I$(top_srcdir)
-AM_CFLAGS = $(LIBXML_CFLAGS)
+AM_CFLAGS = $(LIBXML_CFLAGS) $(LIBXSLT_CFLAGS)
 DEPENDENCIES = $(LIBXSLT_LIBS)
 LDADD = $(LIBXSLT_LIBS) \
         $(LIBXML_LIBS) $(EXTRA_LIBS) $(LIBM)
index 1d376b6..f68df0f 100644 (file)
@@ -74,7 +74,7 @@ while test $# -gt 0; do
        ;;
 
     --cflags)
-        cflags="@LIBXML_CFLAGS@"
+        cflags="@LIBXML_CFLAGS@ @LIBXSLT_CFLAGS@"
         if test "$includedir" != "/usr/include"; then
             cflags="$cflags @XSLT_INCLUDEDIR@"
         fi
index 9416da6..7ddac9d 100644 (file)
@@ -7,7 +7,7 @@ bin_PROGRAMS = xsltproc
 
 noinst_PROGRAMS=testThreads
 
-AM_CFLAGS = $(LIBGCRYPT_CFLAGS) $(LIBXML_CFLAGS)
+AM_CFLAGS = $(LIBGCRYPT_CFLAGS) $(LIBXML_CFLAGS) $(LIBXSLT_CFLAGS)
 
 xsltproc_SOURCES = xsltproc.c
 xsltproc_LDFLAGS =