|
|
@@ -391,16 +391,29 @@ public class ExecTask extends Task { |
|
|
|
|
|
|
|
// couldn't find it - must be on path |
|
|
|
if (searchPath) { |
|
|
|
Path p = null; |
|
|
|
String[] environment = env.getVariables(); |
|
|
|
if (environment != null) { |
|
|
|
for (int i = 0; i < environment.length; i++) { |
|
|
|
if (isPath(environment[i])) { |
|
|
|
p = new Path(getProject(), |
|
|
|
environment[i].substring(5)); |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (p == null) { |
|
|
|
Vector env = Execute.getProcEnvironment(); |
|
|
|
Enumeration e = env.elements(); |
|
|
|
Path p = null; |
|
|
|
while (e.hasMoreElements()) { |
|
|
|
String line = (String) e.nextElement(); |
|
|
|
if (line.startsWith("PATH=") || line.startsWith("Path=")) { |
|
|
|
if (isPath(line)) { |
|
|
|
p = new Path(getProject(), line.substring(5)); |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (p != null) { |
|
|
|
String[] dirs = p.list(); |
|
|
@@ -647,4 +660,8 @@ public class ExecTask extends Task { |
|
|
|
protected void logFlush() { |
|
|
|
} |
|
|
|
|
|
|
|
private boolean isPath(String line) { |
|
|
|
return line.startsWith("PATH=") || line.startsWith("Path="); |
|
|
|
} |
|
|
|
|
|
|
|
} |