Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Inglis2003-11-13 22:04:21 +0000
committerDavid Inglis2003-11-13 22:04:21 +0000
commit71ace4a8977cf34c5d0d7b3733cb06937297f9b3 (patch)
treef5cd7997752ae9a15c4382a42cffbb55c8cdee81
parent104831688d78aad66d4cf178bbab1d87b1189165 (diff)
downloadorg.eclipse.cdt-71ace4a8977cf34c5d0d7b3733cb06937297f9b3.tar.gz
org.eclipse.cdt-71ace4a8977cf34c5d0d7b3733cb06937297f9b3.tar.xz
org.eclipse.cdt-71ace4a8977cf34c5d0d7b3733cb06937297f9b3.zip
Fixed #46431
-rw-r--r--core/org.eclipse.cdt.core/ChangeLog4
-rw-r--r--core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/spawner/EnvironmentReader.java21
2 files changed, 15 insertions, 10 deletions
diff --git a/core/org.eclipse.cdt.core/ChangeLog b/core/org.eclipse.cdt.core/ChangeLog
index 239b6f9cf3a..ff65943b48b 100644
--- a/core/org.eclipse.cdt.core/ChangeLog
+++ b/core/org.eclipse.cdt.core/ChangeLog
@@ -1,3 +1,7 @@
+2003-11-13 David Inglis
+ Fixed #46431
+ * utils/org/eclipse/cdt/utils/spawner/EnvironmentReader.java
+
2003-11-06 David Inglis
Fix for 45835 also changed binary runner control to stop running when project closes/open/deleted
diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/spawner/EnvironmentReader.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/spawner/EnvironmentReader.java
index 4606955cc7c..ec853a3005f 100644
--- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/spawner/EnvironmentReader.java
+++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/spawner/EnvironmentReader.java
@@ -12,7 +12,6 @@ import java.io.InputStream;
import java.util.Properties;
import java.util.Vector;
-
public class EnvironmentReader {
private static Properties envVars = null;
private static Vector rawVars = null;
@@ -27,21 +26,21 @@ public class EnvironmentReader {
envVars = new Properties();
rawVars = new Vector(32);
String command = "env";
- InputStream in = null;
+ InputStream in = null;
boolean check_ready = false;
+ boolean isWin32 = false;
try {
if (OS.indexOf("windows 9") > -1) {
command = "command.com /c set";
//The buffered stream doesn't always like windows 98
check_ready = true;
-
- } else if ((OS.indexOf("nt") > -1)
- || (OS.indexOf("windows 2000") > -1)
- || (OS.indexOf("windows xp") > -1)) {
+ isWin32 = true;
+ } else if ((OS.indexOf("nt") > -1) || (OS.indexOf("windows 2000") > -1) || (OS.indexOf("windows xp") > -1)) {
command = "cmd.exe /c set";
+ isWin32 = true;
}
p = ProcessFactory.getFactory().exec(command);
- in = p .getInputStream();
+ in = p.getInputStream();
BufferedReader br = new BufferedReader(new InputStreamReader(in));
String line;
while ((line = br.readLine()) != null) {
@@ -49,12 +48,14 @@ public class EnvironmentReader {
int idx = line.indexOf('=');
if (idx != -1) {
String key = line.substring(0, idx);
+ if (isWin32) //Since windows env ignores case let normalize to Upper here.
+ key = key.toUpperCase();
String value = line.substring(idx + 1);
envVars.setProperty(key, value);
} else {
envVars.setProperty(line, "");
}
- if(check_ready && br.ready() == false) {
+ if (check_ready && br.ready() == false) {
break;
}
}
@@ -80,9 +81,9 @@ public class EnvironmentReader {
Properties p = getEnvVars();
return p.getProperty(key);
}
-
+
public static String[] getRawEnvVars() {
getEnvVars();
- return (String[])rawVars.toArray( new String[0] );
+ return (String[]) rawVars.toArray(new String[0]);
}
}

Back to the top