diff options
Diffstat (limited to 'src/nix-env')
-rw-r--r-- | src/nix-env/main.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/nix-env/main.cc b/src/nix-env/main.cc index 7ec2667e75c8..0fb115533f18 100644 --- a/src/nix-env/main.cc +++ b/src/nix-env/main.cc @@ -804,7 +804,7 @@ static void opQuery(Globals & globals, /* Print the desired columns, or XML output. */ Table table; ostringstream dummy; - XMLWriter xml(*(xmlOutput ? &cout : &dummy)); + XMLWriter xml(true, *(xmlOutput ? &cout : &dummy)); XMLOpenElement xmlRoot(xml, "items"); for (vector<DrvInfo>::iterator i = elems2.begin(); @@ -903,10 +903,9 @@ static void opQuery(Globals & globals, columns.push_back(descr); } - if (xmlOutput) { + if (xmlOutput) xml.writeEmptyElement("item", attrs); - xml.writeCharData("\n"); - } else + else table.push_back(columns); } catch (AssertionError & e) { |