diff options
-rw-r--r-- | .gitlab-ci.yml | 3 | ||||
-rw-r--r-- | Makefile.am | 15 | ||||
-rw-r--r-- | NEWS | 14 | ||||
-rw-r--r-- | configure.ac | 19 | ||||
-rw-r--r-- | libexslt/Makefile.am | 2 | ||||
-rw-r--r-- | libxslt/Makefile.am | 2 | ||||
-rw-r--r-- | libxslt/functions.c | 12 | ||||
-rw-r--r-- | libxslt/keys.c | 2 | ||||
-rw-r--r-- | libxslt/numbers.c | 14 | ||||
-rw-r--r-- | libxslt/pattern.c | 22 | ||||
-rw-r--r-- | libxslt/transform.c | 4 | ||||
-rw-r--r-- | python/Makefile.am | 9 | ||||
-rw-r--r-- | python/libxslt.c | 1 | ||||
-rw-r--r-- | tests/fuzz/Makefile.am | 2 | ||||
-rw-r--r-- | xslt-config.in | 2 | ||||
-rw-r--r-- | xsltproc/Makefile.am | 2 |
16 files changed, 83 insertions, 42 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2ca5355b..d4af61c8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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: diff --git a/Makefile.am b/Makefile.am index d5d6a4cf..a2d766f5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 @@ -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 diff --git a/configure.ac b/configure.ac index 3cb0f648..baeee600 100644 --- a/configure.ac +++ b/configure.ac @@ -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" diff --git a/libexslt/Makefile.am b/libexslt/Makefile.am index 46d4371e..c2dc6364 100644 --- a/libexslt/Makefile.am +++ b/libexslt/Makefile.am @@ -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 diff --git a/libxslt/Makefile.am b/libxslt/Makefile.am index 4b131d50..9560dc3b 100644 --- a/libxslt/Makefile.am +++ b/libxslt/Makefile.am @@ -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 diff --git a/libxslt/functions.c b/libxslt/functions.c index fa8b6d93..ed2b0023 100644 --- a/libxslt/functions.c +++ b/libxslt/functions.c @@ -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) { diff --git a/libxslt/keys.c b/libxslt/keys.c index ecef5382..ca0779c5 100644 --- a/libxslt/keys.c +++ b/libxslt/keys.c @@ -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] != '|')) { diff --git a/libxslt/numbers.c b/libxslt/numbers.c index 4cb21254..9c74f0d4 100644 --- a/libxslt/numbers.c +++ b/libxslt/numbers.c @@ -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; diff --git a/libxslt/pattern.c b/libxslt/pattern.c index 1944661c..da3444f2 100644 --- a/libxslt/pattern.c +++ b/libxslt/pattern.c @@ -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; diff --git a/libxslt/transform.c b/libxslt/transform.c index 2d8fd7f9..cb43bb47 100644 --- a/libxslt/transform.c +++ b/libxslt/transform.c @@ -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) { diff --git a/python/Makefile.am b/python/Makefile.am index 24ede9c3..fa7ed00b 100644 --- a/python/Makefile.am +++ b/python/Makefile.am @@ -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__ diff --git a/python/libxslt.c b/python/libxslt.c index 353939e3..0758d606 100644 --- a/python/libxslt.c +++ b/python/libxslt.c @@ -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 */ diff --git a/tests/fuzz/Makefile.am b/tests/fuzz/Makefile.am index 7e22bd99..5f4d90b6 100644 --- a/tests/fuzz/Makefile.am +++ b/tests/fuzz/Makefile.am @@ -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) diff --git a/xslt-config.in b/xslt-config.in index 1d376b66..f68df0f7 100644 --- a/xslt-config.in +++ b/xslt-config.in @@ -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 diff --git a/xsltproc/Makefile.am b/xsltproc/Makefile.am index 9416da6c..7ddac9d2 100644 --- a/xsltproc/Makefile.am +++ b/xsltproc/Makefile.am @@ -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 = |