about summary refs log tree commit diff
path: root/src/libutil
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2012-10-04T18·07-0400
committerEelco Dolstra <eelco.dolstra@logicblox.com>2012-10-04T18·07-0400
commitad328bea15e2708e5aa784c33ba8bfbc86d02e0d (patch)
treee1073a8881c236d3ab5e934f97cdbde5c57122b6 /src/libutil
parentbfaa5635de8ed83085dfeb265227cc25a32ce07c (diff)
XML writer: flush after newlines
This is useful for hydra-eval-jobs.
Diffstat (limited to 'src/libutil')
-rw-r--r--src/libutil/xml-writer.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libutil/xml-writer.cc b/src/libutil/xml-writer.cc
index 7d698bf6aed5..16dfb6ddc903 100644
--- a/src/libutil/xml-writer.cc
+++ b/src/libutil/xml-writer.cc
@@ -9,7 +9,7 @@ namespace nix {
 XMLWriter::XMLWriter(bool indent, std::ostream & output)
     : output(output), indent(indent)
 {
-    output << "<?xml version='1.0' encoding='utf-8'?>\n";
+    output << "<?xml version='1.0' encoding='utf-8'?>" << std::endl;
     closed = false;
 }
 
@@ -43,7 +43,7 @@ void XMLWriter::openElement(const string & name,
     output << "<" << name;
     writeAttrs(attrs);
     output << ">";
-    if (indent) output << "\n";
+    if (indent) output << std::endl;
     pendingElems.push_back(name);
 }
 
@@ -53,7 +53,7 @@ void XMLWriter::closeElement()
     assert(!pendingElems.empty());
     indent_(pendingElems.size() - 1);
     output << "</" << pendingElems.back() << ">";
-    if (indent) output << "\n";
+    if (indent) output << std::endl;
     pendingElems.pop_back();
     if (pendingElems.empty()) closed = true;
 }
@@ -67,7 +67,7 @@ void XMLWriter::writeEmptyElement(const string & name,
     output << "<" << name;
     writeAttrs(attrs);
     output << " />";
-    if (indent) output << "\n";
+    if (indent) output << std::endl;
 }