Permalink
Browse files

Fix bug where stdin was never closed if there were no documents on th…

…e input port
  • Loading branch information...
ndw committed Jan 9, 2012
1 parent 50ca49e commit d8c8291dd9286f712ce4f51a77c04a9497fa3540
Showing with 10 additions and 3 deletions.
  1. +10 −3 src/com/xmlcalabash/library/Exec.java
@@ -222,6 +222,9 @@ public void run() throws SaxonApiException {
xqeval.setDestination(serializer);
xqeval.run();
os.close();
} else {
OutputStream os = process.getOutputStream();
os.close();
}
@@ -255,10 +258,14 @@ public void run() throws SaxonApiException {
tree.addText("" + rc);
tree.addEndElement();
tree.endDocument();
status.write(tree.getResult());
XdmNode execResult = tree.getResult();
status.write(execResult);
execResult = stdoutReader.getResult();
result.write(execResult);
result.write(stdoutReader.getResult());
errors.write(stderrReader.getResult());
execResult = stderrReader.getResult();
errors.write(execResult);
} catch (IOException ex) {
throw new XProcException(ex);
}

0 comments on commit d8c8291

Please sign in to comment.