projects
/
SXSI
/
xpathcomp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
32a3f16
)
Don't flush the XML printing buffer if nothing was printed.
author
Kim Nguyễn
<kn@lri.fr>
Wed, 2 May 2012 12:24:36 +0000
(14:24 +0200)
committer
Kim Nguyễn
<kn@lri.fr>
Wed, 2 May 2012 12:24:36 +0000
(14:24 +0200)
src/nodeSet.ml
patch
|
blob
|
history
diff --git
a/src/nodeSet.ml
b/src/nodeSet.ml
index
944f85c
..
0828029
100644
(file)
--- a/
src/nodeSet.ml
+++ b/
src/nodeSet.ml
@@
-200,8
+200,10
@@
module Mat : S with type t = Tree.node mat =
Unix.close
in
ignore (Unix.write fd "<xml_result>\n" 0 13);
- iter (fun node -> Tree.print_xml v node fd) l;
- Tree.flush v fd;
+ if l.length > 0 then begin
+ iter (fun node -> Tree.print_xml v node fd) l;
+ Tree.flush v fd;
+ end;
ignore (Unix.write fd "</xml_result>\n" 0 14);
finish fd