- libxslt/keys.c libxslt/transform.c: avoid some possibilities
authorDaniel Veillard <veillard@src.gnome.org>
Tue, 15 May 2001 12:37:01 +0000 (12:37 +0000)
committerDaniel Veillard <veillard@src.gnome.org>
Tue, 15 May 2001 12:37:01 +0000 (12:37 +0000)
  of crashes on debug
- tests/REC/Makefile.am: be less verbose if things really go wrong
- tests/docs/Makefile.am tests/general/Makefile.am
  tests/docs/bug-28-.xml tests/general/bug-28-.*: added bug-28 in
  the regression tests
Daniel

ChangeLog
libxslt/keys.c
libxslt/transform.c
tests/REC/Makefile.am
tests/docs/Makefile.am
tests/docs/bug-28-.xml [new file with mode: 0644]
tests/general/Makefile.am
tests/general/bug-28-.out [new file with mode: 0644]
tests/general/bug-28-.xsl [new file with mode: 0644]

index 90b28a3..b85680a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+Tue May 15 14:34:23 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
+
+       * libxslt/keys.c libxslt/transform.c: avoid some possibilities
+         of crashes on debug
+       * tests/REC/Makefile.am: be less verbose if things really go wrong
+       * tests/docs/Makefile.am tests/general/Makefile.am
+         tests/docs/bug-28-.xml tests/general/bug-28-.*: added bug-28 in
+         the regression tests
+
 Sat May 12 12:39:54 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
 
        * libxslt/transform.c libxslt/xsltutils.c: fixed the default
index dc49926..be27b6c 100644 (file)
@@ -418,7 +418,8 @@ xsltInitCtxtKeys(xsltTransformContextPtr ctxt, xsltDocumentPtr doc) {
     if ((ctxt == NULL) || (doc == NULL))
        return;
 #ifdef WITH_XSLT_DEBUG_KEYS
-    xsltGenericDebug(xsltGenericDebugContext, "Initializing keys on %s\n",
+    if ((doc->doc != NULL) && (doc->doc->URL != NULL))
+       xsltGenericDebug(xsltGenericDebugContext, "Initializing keys on %s\n",
                     doc->doc->URL);
 #endif
     style = ctxt->style;
index e41ac90..a12de9d 100644 (file)
@@ -1998,8 +1998,9 @@ xsltApplyTemplates(xsltTransformContextPtr ctxt, xmlNodePtr node,
        return;
 
 #ifdef WITH_XSLT_DEBUG_PROCESS
-    xsltGenericDebug(xsltGenericDebugContext,
-        "xsltApplyTemplates: node: %s\n", node->name);
+    if ((node != NULL) && (node->name != NULL))
+       xsltGenericDebug(xsltGenericDebugContext,
+            "xsltApplyTemplates: node: %s\n", node->name);
 #endif
 
     /*
index 4823d54..ac41721 100644 (file)
@@ -74,7 +74,8 @@ test tests: $(top_builddir)/libxslt/xsltproc
          echo $$name.xml ; \
          $(top_builddir)/libxslt/xsltproc $(srcdir)/$$name.xsl $(srcdir)/$$name.xml > $$name.res;\
          if [ ! -f $(srcdir)/$$name.out ] ; then cp $$name.res $(srcdir)/$$name.out ; \
-         else diff $(srcdir)/$$name.out $$name.res ; fi ; \
+         else if  [ ! -s $$name.res ] ; then echo "Fatal error, no $$name.res\n" ; \
+         else diff $(srcdir)/$$name.out $$name.res ; fi ; fi; \
          grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
          rm -f $$name.res ; \
          done)
index af02134..63e1f84 100644 (file)
@@ -32,6 +32,7 @@ EXTRA_DIST =  \
        bug-25-.xml \
        bug-26-.xml \
        bug-27-.xml \
+       bug-28-.xml \
        character.xml \
        items.xml
 
diff --git a/tests/docs/bug-28-.xml b/tests/docs/bug-28-.xml
new file mode 100644 (file)
index 0000000..69d62f2
--- /dev/null
@@ -0,0 +1 @@
+<doc/>
index 2dd4812..8d6def1 100644 (file)
@@ -31,6 +31,7 @@ EXTRA_DIST = \
     bug-25-.out bug-25-.xsl \
     bug-26-.out bug-26-.xsl \
     bug-27-.out bug-27-.xsl \
+    bug-28-.out bug-28-.xsl \
     character.out character.xsl \
     character2.out character2.xsl \
     itemschoose.out itemschoose.xsl \
diff --git a/tests/general/bug-28-.out b/tests/general/bug-28-.out
new file mode 100644 (file)
index 0000000..18ecdcb
--- /dev/null
@@ -0,0 +1 @@
+<html></html>
diff --git a/tests/general/bug-28-.xsl b/tests/general/bug-28-.xsl
new file mode 100644 (file)
index 0000000..ad4331e
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+               version="1.0">
+
+  <xsl:template match="/">
+    <html></html>
+  </xsl:template>
+
+</xsl:stylesheet>