diff --git a/debug/org.eclipse.cdt.debug.mi.core/ChangeLog b/debug/org.eclipse.cdt.debug.mi.core/ChangeLog index e1ddf21b760..202ee282d8e 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/ChangeLog +++ b/debug/org.eclipse.cdt.debug.mi.core/ChangeLog @@ -1,3 +1,8 @@ +2004-06-22 Alain Magloire + + Fix PR 68176 + * mi/org/eclipse/cdt/debug/mi/core/command/CygwinMIEnvironmentCD.java + 2004-06-09 Alain Magloire Fix for PR 66338 * cdi/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/CygwinMIEnvironmentCD.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/CygwinMIEnvironmentCD.java index 1da55a91cd7..0b64a0a8bf5 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/CygwinMIEnvironmentCD.java +++ b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/CygwinMIEnvironmentCD.java @@ -12,6 +12,7 @@ package org.eclipse.cdt.debug.mi.core.command; import java.io.ByteArrayOutputStream; +import java.io.IOException; import org.eclipse.cdt.core.CommandLauncher; import org.eclipse.core.runtime.Path; @@ -29,7 +30,7 @@ public class CygwinMIEnvironmentCD extends MIEnvironmentCD { // Use the cygpath utility to convert the path CommandLauncher launcher = new CommandLauncher(); - ByteArrayOutputStream output = new ByteArrayOutputStream(); + ByteArrayOutputStream out = new ByteArrayOutputStream(); ByteArrayOutputStream err = new ByteArrayOutputStream(); String newPath = null; @@ -38,14 +39,23 @@ public class CygwinMIEnvironmentCD extends MIEnvironmentCD { new String[] { "-u", path }, //$NON-NLS-1$ new String[0], new Path(".")); //$NON-NLS-1$ - if (launcher.waitAndRead(output, err) == CommandLauncher.OK) { - newPath = output.toString().trim(); - if (newPath != null && newPath.length() > 0) { - path = newPath; + if (launcher.waitAndRead(out, err) == CommandLauncher.OK) { + newPath = out.toString(); + if (newPath != null) { + newPath = newPath.trim(); + if (newPath.length() > 0) { + path = newPath; + } } } + try { + out.close(); + err.close(); + } catch (IOException e) { + // ignore. + } - setParameters(new String[]{newPath}); + setParameters(new String[]{path}); }