summaryrefslogtreecommitdiff
path: root/debian/patches/0006-properly-quote-the-namespace-uris-written-out-during.patch
blob: 682fb414a60d1486f08cfcfdcf0ed1d6ff0e63d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
From: Aleksey Sanin <aleksey@aleksey.com>
Date: Thu, 9 May 2013 16:02:16 +0000
Subject: properly quote the namespace uris written out during c14n

---
 c14n.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/c14n.c b/c14n.c
index afd95b3..ca77f92 100644
--- a/c14n.c
+++ b/c14n.c
@@ -547,14 +547,15 @@ xmlC14NPrintNamespaces(const xmlNsPtr ns, xmlC14NCtxPtr ctx)
     if (ns->prefix != NULL) {
         xmlOutputBufferWriteString(ctx->buf, " xmlns:");
         xmlOutputBufferWriteString(ctx->buf, (const char *) ns->prefix);
-        xmlOutputBufferWriteString(ctx->buf, "=\"");
+        xmlOutputBufferWriteString(ctx->buf, "=");
     } else {
-        xmlOutputBufferWriteString(ctx->buf, " xmlns=\"");
+        xmlOutputBufferWriteString(ctx->buf, " xmlns=");
     }
     if(ns->href != NULL) {
-	xmlOutputBufferWriteString(ctx->buf, (const char *) ns->href);
+	xmlBufWriteQuotedString(ctx->buf->buffer, ns->href);
+    } else {
+    	xmlOutputBufferWriteString(ctx->buf, "\"\"");
     }
-    xmlOutputBufferWriteString(ctx->buf, "\"");
     return (1);
 }