|
|
|
@@ -163,10 +163,29 @@ public class Execute { |
|
|
|
|
|
|
|
BufferedReader in = |
|
|
|
new BufferedReader(new StringReader(out.toString())); |
|
|
|
String line; |
|
|
|
String var = null; |
|
|
|
String line, lineSep = System.getProperty("line.separator"); |
|
|
|
while ((line = in.readLine()) != null) { |
|
|
|
procEnvironment.addElement(line); |
|
|
|
if (line.indexOf('=') == -1) { |
|
|
|
// Chunk part of previous env var (UNIX env vars can |
|
|
|
// contain embedded new lines). |
|
|
|
if (var == null) { |
|
|
|
var = lineSep + line; |
|
|
|
} |
|
|
|
else { |
|
|
|
var += lineSep + line; |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
// New env var...append the previous one if we have it. |
|
|
|
if (var != null) { |
|
|
|
procEnvironment.addElement(var); |
|
|
|
} |
|
|
|
var = line; |
|
|
|
} |
|
|
|
} |
|
|
|
// Since we "look ahead" before adding, there's one last env var. |
|
|
|
procEnvironment.addElement(var); |
|
|
|
} |
|
|
|
catch (java.io.IOException exc) { |
|
|
|
exc.printStackTrace(); |
|
|
|
|