diff --git a/documentation/ChangeLog.md b/documentation/ChangeLog.md index 01efaa321..c10a32132 100644 --- a/documentation/ChangeLog.md +++ b/documentation/ChangeLog.md @@ -1,6 +1,7 @@ ## release ChangeLog ### (NextVersion) + * Fixed: when invoking toolchain programs, add tool directory to beginning of PATH, not end. * Fixed: In Linux, the "Build Target" group UI widget height is broken, too short. (#150) * Fixed: if build tool reports many error messages, the Eclipse project build will take too long to finish. * Added UserGuide note about using Homebrew GDB in OS X. diff --git a/plugin_tooling/src-lang/melnorme/lang/utils/ProcessUtils.java b/plugin_tooling/src-lang/melnorme/lang/utils/ProcessUtils.java index bd1502679..d53b80b8b 100644 --- a/plugin_tooling/src-lang/melnorme/lang/utils/ProcessUtils.java +++ b/plugin_tooling/src-lang/melnorme/lang/utils/ProcessUtils.java @@ -22,6 +22,7 @@ import melnorme.utilbox.core.CommonException; import melnorme.utilbox.misc.Location; import melnorme.utilbox.misc.MiscUtil; +import melnorme.utilbox.misc.StringUtil; public class ProcessUtils { @@ -69,10 +70,9 @@ public static void addDirToPathEnv(Path cmdExePath, ProcessBuilder pb) { return; } - pathEnv = (pathEnv == null) ? "" : pathEnv + File.pathSeparator; - pathEnv += cmdDir.toString(); + String newPathEnv = cmdDir.toString() + File.pathSeparator + StringUtil.nullAsEmpty(pathEnv); - putVarInEnvMap(environment, "PATH", pathEnv); + putVarInEnvMap(environment, "PATH", newPathEnv); } public static String getVarFromEnvMap(Map envMap, String key) {