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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
|
Subject: xmlstarlet: use debug functions only if libxml2 has debug support
From: Robert Schwebel <r.schwebel@pengutronix.de>
We use xmlXPathDebugDumpCompExpr without testing if libxml2 has support
for it enabled. This can result in the following linker error:
xml_edit.o: In function `edUpdate':
xmlstarlet-1.0.1/src/xml_edit.c:327:
undefined reference to `xmlXPathDebugDumpCompExpr'
Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
---
#20091129: rsc: submitted to upstream:
# https://sourceforge.net/tracker/?func=detail&aid=2905668&group_id=66612&atid=515108
src/xml_edit.c | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
Index: xmlstarlet-1.0.1/src/xml_edit.c
===================================================================
--- xmlstarlet-1.0.1.orig/src/xml_edit.c
+++ xmlstarlet-1.0.1/src/xml_edit.c
@@ -323,9 +323,10 @@ edUpdate(xmlDocPtr doc, const char *loc,
comp = xmlXPathCompile(BAD_CAST loc);
if (comp != NULL)
{
+#if defined(LIBXML_DEBUG_ENABLED)
if (tree)
xmlXPathDebugDumpCompExpr(stdout, comp, 0);
-
+#endif
res = xmlXPathCompiledEval(comp, ctxt);
xmlXPathFreeCompExpr(comp);
}
@@ -406,9 +407,10 @@ edInsert(xmlDocPtr doc, const char *loc,
comp = xmlXPathCompile(BAD_CAST loc);
if (comp != NULL)
{
+#if defined(LIBXML_DEBUG_ENABLED)
if (tree)
xmlXPathDebugDumpCompExpr(stdout, comp, 0);
-
+#endif
res = xmlXPathCompiledEval(comp, ctxt);
xmlXPathFreeCompExpr(comp);
}
@@ -508,9 +510,10 @@ edRename(xmlDocPtr doc, char *loc, char
comp = xmlXPathCompile(BAD_CAST loc);
if (comp != NULL)
{
+#if defined(LIBXML_DEBUG_ENABLED)
if (tree)
xmlXPathDebugDumpCompExpr(stdout, comp, 0);
-
+#endif
res = xmlXPathCompiledEval(comp, ctxt);
xmlXPathFreeCompExpr(comp);
}
@@ -599,9 +602,10 @@ edDelete(xmlDocPtr doc, char *str)
comp = xmlXPathCompile(BAD_CAST str);
if (comp != NULL)
{
+#if defined(LIBXML_DEBUG_ENABLED)
if (tree)
xmlXPathDebugDumpCompExpr(stdout, comp, 0);
-
+#endif
res = xmlXPathCompiledEval(comp, ctxt);
xmlXPathFreeCompExpr(comp);
}
@@ -691,9 +695,10 @@ edMove(xmlDocPtr doc, char *from, char *
comp = xmlXPathCompile(BAD_CAST from);
if (comp != NULL)
{
+#if defined(LIBXML_DEBUG_ENABLED)
if (tree)
xmlXPathDebugDumpCompExpr(stdout, comp, 0);
-
+#endif
res = xmlXPathCompiledEval(comp, ctxt);
xmlXPathFreeCompExpr(comp);
}
@@ -738,9 +743,10 @@ edMove(xmlDocPtr doc, char *from, char *
comp = xmlXPathCompile(BAD_CAST to);
if (comp != NULL)
{
+#if defined(LIBXML_DEBUG_ENABLED)
if (tree)
xmlXPathDebugDumpCompExpr(stdout, comp, 0);
-
+#endif
res_to = xmlXPathCompiledEval(comp, ctxt);
xmlXPathFreeCompExpr(comp);
}
|