Skip to content
This repository has been archived by the owner on Feb 9, 2018. It is now read-only.

Commit

Permalink
OutputParams PATH fix contd
Browse files Browse the repository at this point in the history
  • Loading branch information
skeptical committed Aug 9, 2012
1 parent 541d3e5 commit fec6853
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/main/java/net/pms/io/ProcessWrapperImpl.java
Expand Up @@ -132,9 +132,19 @@ public void run() {
}
if (params.env != null && !params.env.isEmpty()) {
Map<String,String> environment = pb.environment();
String PATH = params.env.get("PATH") + File.pathSeparator + environment.get("PATH");
// actual name of system path var is case-sensitive
String sysPathKey = PMS.get().isWindows() ? "Path" : "PATH";
// as is Map
String PATH = params.env.containsKey("PATH") ? params.env.get("PATH") :
params.env.containsKey("path") ? params.env.get("path") :
params.env.containsKey("Path") ? params.env.get("Path") : null;
if (PATH != null) {
PATH += (File.pathSeparator + environment.get(sysPathKey));
}
environment.putAll(params.env);
environment.put("PATH", PATH);
if (PATH != null) {
environment.put(sysPathKey, PATH);
}
}
process = pb.start();
PMS.get().currentProcesses.add(process);
Expand Down

0 comments on commit fec6853

Please sign in to comment.