Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > media > main-src > by-pkgid > d41e7febba7533a5711c18660c676cc9 > files > 14

libxslt-1.1.17-4.el5_8.3.src.rpm

From 649c8ae8523f4be7d7c2f474fde413f8b6ae7bd0 Mon Sep 17 00:00:00 2001
From: Nick Wellnhofer <wellnhofer@aevum.de>
Date: Wed, 15 Aug 2012 23:06:14 +0200
Subject: [PATCH] Fix system-property with unknown namespace
To: libvir-list@redhat.com

The empty string should be returned, see bug #631803.

Signed-off-by: Daniel Veillard <veillard@redhat.com>
---
 libxslt/functions.c       |  4 +++-
 tests/docs/bug-176.xml    |  1 +
 tests/general/bug-176.out |  2 ++
 tests/general/bug-176.xsl | 11 +++++++++++
 4 files changed, 17 insertions(+), 1 deletion(-)
 create mode 100644 tests/docs/bug-176.xml
 create mode 100644 tests/general/bug-176.out
 create mode 100644 tests/general/bug-176.xsl

diff --git a/libxslt/functions.c b/libxslt/functions.c
index ce944e1..5752467 100644
--- a/libxslt/functions.c
+++ b/libxslt/functions.c
@@ -738,7 +738,9 @@ xsltSystemPropertyFunction(xmlXPathParserContextPtr ctxt, int nargs){
 	    } else {
 		valuePush(ctxt, xmlXPathNewString((const xmlChar *)""));
 	    }
-	}
+	} else {
+	    valuePush(ctxt, xmlXPathNewString((const xmlChar *)""));
+        }
 	if (name != NULL)
 	    xmlFree(name);
 	if (prefix != NULL)
diff --git a/tests/docs/bug-176.xml b/tests/docs/bug-176.xml
new file mode 100644
index 0000000..69d62f2
--- /dev/null
+++ b/tests/docs/bug-176.xml
@@ -0,0 +1 @@
+<doc/>
diff --git a/tests/general/bug-176.out b/tests/general/bug-176.out
new file mode 100644
index 0000000..995c0a4
--- /dev/null
+++ b/tests/general/bug-176.out
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<result></result>
diff --git a/tests/general/bug-176.xsl b/tests/general/bug-176.xsl
new file mode 100644
index 0000000..6996e1e
--- /dev/null
+++ b/tests/general/bug-176.xsl
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+               xmlns:msxsl="urn:schemas-microsoft-com:xslt"
+               exclude-result-prefixes="msxsl"
+               version="1.0">
+    <xsl:template match="/">
+        <result>
+            <xsl:value-of select="system-property('msxsl:version')"/>
+        </result>
+    </xsl:template>
+</xsl:transform>
-- 
1.7.11.4