From 3822116151b3ef49ef7ed98b90efcef46f61875d Mon Sep 17 00:00:00 2001 From: "William M. Brack" Date: Fri, 15 Aug 2003 05:08:57 +0000 Subject: [PATCH] fixed bug 119699 (missing error on shadowed variable) removed dependency * variables.c: fixed bug 119699 (missing error on shadowed variable) * autogen.sh: removed dependency on automake-1.4, updated links for fetching auto* tools * doc/Makefile.am: added check for automatic regeneration of win32/*.def.src when api xml files are updated. --- ChangeLog | 9 ++++ autogen.sh | 30 +++++++------ doc/Makefile.am | 15 ++++++- libxslt/variables.c | 119 +++++++++++++++++++++++++--------------------------- 4 files changed, 93 insertions(+), 80 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9edaac8..67335c9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Thu Aug 15 13:00:02 HKT 2003 William Brack + + * variables.c: fixed bug 119699 (missing error on shadowed + variable) + * autogen.sh: removed dependency on automake-1.4, updated + links for fetching auto* tools + * doc/Makefile.am: added check for automatic regeneration of + win32/*.def.src when api xml files are updated. + Thu Aug 14 23:15:14 HKT 2003 William Brack * transform.c: fixed bug 114563 (params not passed when diff --git a/autogen.sh b/autogen.sh index 5548f69..464008b 100755 --- a/autogen.sh +++ b/autogen.sh @@ -10,26 +10,26 @@ DIE=0 (autoconf --version) < /dev/null > /dev/null 2>&1 || { echo - echo "You must have autoconf installed to compile gnome-xml." + echo "You must have autoconf installed to compile libxslt." echo "Download the appropriate package for your distribution," - echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" + echo "or see http://www.gnu.org/software/autoconf" DIE=1 } (libtool --version) < /dev/null > /dev/null 2>&1 || { echo - echo "You must have libtool installed to compile gnome-xml." - echo "Get ftp://alpha.gnu.org/gnu/libtool-1.0h.tar.gz" - echo "(or a newer version if it is available)" + echo "You must have libtool installed to compile libxslt." + echo "Download the appropriate package for your distribution," + echo "or see http://www.gnu.org/software/libtool" DIE=1 } -(automake-1.4 --version) < /dev/null > /dev/null 2>&1 || { +(automake --version) < /dev/null > /dev/null 2>&1 || { echo - echo "You must have automake installed to compile gnome-xml." - echo "Get ftp://ftp.cygnus.com/pub/home/tromey/automake-1.2d.tar.gz" - echo "(or a newer version if it is available)" DIE=1 + echo "You must have automake installed to compile libxslt." + echo "Download the appropriate package for your distribution," + echo "or see http://www.gnu.org/software/automake" } if test "$DIE" -eq 1; then @@ -37,7 +37,7 @@ if test "$DIE" -eq 1; then fi test -f libxslt/xslt.h || { - echo "You must run this script in the top-level gdome directory" + echo "You must run this script in the top-level libxslt directory" exit 1 } @@ -49,9 +49,9 @@ fi echo "Running libtoolize..." libtoolize --copy --force echo "Running aclocal..." -aclocal-1.4 $ACLOCAL_FLAGS +aclocal $ACLOCAL_FLAGS echo "Running automake..." -automake-1.4 --add-missing +automake --add-missing echo "Running autoconf..." autoconf @@ -62,10 +62,8 @@ if test x$OBJ_DIR != x; then cd "$OBJ_DIR" fi -conf_flags="--enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c - -echo Running configure $conf_flags "$@" ... -$srcdir/configure $conf_flags "$@" +echo Running configure "$@" ... +$srcdir/configure "$@" echo echo "Now type 'make' to compile libxslt." diff --git a/doc/Makefile.am b/doc/Makefile.am index 4b2a734..a0351d5 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -19,6 +19,9 @@ DOC_SOURCE_DIR=.. HTML_DIR=$(datadir)/doc +# A file in win32 depends upon two of the doc files +WIN32_DIR=$(top_srcdir)/win32 + TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE)/html PAGES= API.html bugs.html contribs.html docs.html downloads.html \ help.html index.html intro.html news.html xsltproc2.html FAQ.html @@ -73,7 +76,17 @@ html: libxslt-api.xml libexslt-api.xml: apibuild.py ../libxslt/*.h ../libxslt/*.c ../libexslt/*.h ../libexslt/*.c -(./apibuild.py) -api: libxslt-api.xml libxslt-refs.xml +$(WIN32_DIR)/libxslt.def.src: libxslt-api.xml + -@(if [ -x $(bindir)/xsltproc ] ; then \ + $(bindir)/xsltproc -o $(WIN32_DIR)/libxslt.def.src \ + --nonet $(WIN32_DIR)/defgen.xsl libxslt-api.xml ; fi ) + +$(WIN32_DIR)/libexslt.def.src: libexslt-api.xml + -@(if [ -x $(bindir)/xsltproc ] ; then \ + $(bindir)/xsltproc -o $(WIN32_DIR)/libexslt.def.src \ + --nonet $(WIN32_DIR)/defgen.xsl libexslt-api.xml ; fi ) + +api: libxslt-api.xml libxslt-refs.xml $(WIN32_DIR)/libxslt.def.src $(WIN32_DIR)/libexslt.def.src clean-local: rm -f *~ *.bak *.hierarchy *.signals *-unused.txt diff --git a/libxslt/variables.c b/libxslt/variables.c index 800ac50..a543ae4 100644 --- a/libxslt/variables.c +++ b/libxslt/variables.c @@ -234,6 +234,52 @@ xsltFreeStackElemList(xsltStackElemPtr elem) { } /** + * xsltStackLookup: + * @ctxt: an XSLT transformation context + * @name: the local part of the name + * @nameURI: the URI part of the name + * + * Locate an element in the stack based on its name. + */ +static xsltStackElemPtr +xsltStackLookup(xsltTransformContextPtr ctxt, const xmlChar *name, + const xmlChar *nameURI) { + xsltStackElemPtr ret = NULL; + int i; + xsltStackElemPtr cur; + + if ((ctxt == NULL) || (name == NULL) || (ctxt->varsNr == 0)) + return(NULL); + + /* + * Do the lookup from the top of the stack, but + * don't use params being computed in a call-param + */ + ; + + for (i = ctxt->varsNr; i > ctxt->varsBase; i--) { + cur = ctxt->varsTab[i-1]; + while (cur != NULL) { + if (xmlStrEqual(cur->name, name)) { + if (nameURI == NULL) { + if (cur->nameURI == NULL) { + return(cur); + } + } else { + if ((cur->nameURI != NULL) && + (xmlStrEqual(cur->nameURI, nameURI))) { + return(cur); + } + } + + } + cur = cur->next; + } + } + return(ret); +} + +/** * xsltCheckStackElem: * @ctxt: xn XSLT transformation context * @name: the variable name @@ -252,24 +298,17 @@ xsltCheckStackElem(xsltTransformContextPtr ctxt, const xmlChar *name, if ((ctxt == NULL) || (name == NULL)) return(-1); - cur = ctxt->vars; - while (cur != NULL) { - if (xmlStrEqual(name, cur->name)) { - if (((nameURI == NULL) && (cur->nameURI == NULL)) || - ((nameURI != NULL) && (cur->nameURI != NULL) && - (xmlStrEqual(nameURI, cur->nameURI)))) { - if ((cur->comp != NULL) && - (cur->comp->type == XSLT_FUNC_WITHPARAM)) - return(3); - if ((cur->comp != NULL) && - (cur->comp->type == XSLT_FUNC_PARAM)) - return(2); - return(1); - } - } - cur = cur->next; + cur = xsltStackLookup(ctxt, name, nameURI); + if (cur == NULL) + return(0); + if (cur->comp != NULL) { + if (cur->comp->type == XSLT_FUNC_WITHPARAM) + return(3); + else if (cur->comp->type == XSLT_FUNC_PARAM) + return(2); } - return(0); + + return(1); } /** @@ -322,52 +361,6 @@ xsltAddStackElemList(xsltTransformContextPtr ctxt, xsltStackElemPtr elems) { return(0); } -/** - * xsltStackLookup: - * @ctxt: an XSLT transformation context - * @name: the local part of the name - * @nameURI: the URI part of the name - * - * Locate an element in the stack based on its name. - */ -static xsltStackElemPtr -xsltStackLookup(xsltTransformContextPtr ctxt, const xmlChar *name, - const xmlChar *nameURI) { - xsltStackElemPtr ret = NULL; - int i; - xsltStackElemPtr cur; - - if ((ctxt == NULL) || (name == NULL) || (ctxt->varsNr == 0)) - return(NULL); - - /* - * Do the lookup from the top of the stack, but - * don't use params being computed in a call-param - */ - ; - - for (i = ctxt->varsNr; i > ctxt->varsBase; i--) { - cur = ctxt->varsTab[i-1]; - while (cur != NULL) { - if (xmlStrEqual(cur->name, name)) { - if (nameURI == NULL) { - if (cur->nameURI == NULL) { - return(cur); - } - } else { - if ((cur->nameURI != NULL) && - (xmlStrEqual(cur->nameURI, nameURI))) { - return(cur); - } - } - - } - cur = cur->next; - } - } - return(ret); -} - /************************************************************************ * * * Module interfaces * -- 2.7.4