diff --git a/WHATSNEW b/WHATSNEW index 5d9a32755..96b39a9ec 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -28,6 +28,8 @@ Fixed bugs: * The "plain" could throw a NullPointerException if an error occured in setUp. +* could hang listcab on large s. + Other changes: -------------- diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/Cab.java b/src/main/org/apache/tools/ant/taskdefs/optional/Cab.java index 798885d2e..04feb6827 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/Cab.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/Cab.java @@ -266,9 +266,6 @@ public class Cab extends MatchingTask { new String[] {"listcab"}, null, baseDir, true); OutputStream out = p.getOutputStream(); - out.write(sb.toString().getBytes()); - out.flush(); - out.close(); // Create the stream pumpers to forward listcab's stdout and stderr to the log // note: listcab is an interactive program, and issues prompts for every new line. @@ -282,6 +279,10 @@ public class Cab extends MatchingTask { (new Thread(outPump)).start(); (new Thread(errPump)).start(); + out.write(sb.toString().getBytes()); + out.flush(); + out.close(); + int result = -99; // A wild default for when the thread is interrupted try {