mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +02:00
Fix PR 68176
* mi/org/eclipse/cdt/debug/mi/core/command/CygwinMIEnvironmentCD.java
This commit is contained in:
parent
70f786631a
commit
3fd15075c3
2 changed files with 21 additions and 6 deletions
|
@ -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
|
||||
|
|
|
@ -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});
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue