Author: jfallows
Date: Sat Aug 20 21:52:07 2011
New Revision: 1159919
URL: http://svn.apache.org/viewvc?rev=1159919&view=rev
Log:
Absolute paths are breaking .exe discovery on non-Windows platforms
Modified:
incubator/npanday/trunk/components/dotnet-core/src/main/java/npanday/PathUtil.java
Modified:
incubator/npanday/trunk/components/dotnet-core/src/main/java/npanday/PathUtil.java
URL:
http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-core/src/main/java/npanday/PathUtil.java?rev=1159919&r1=1159918&r2=1159919&view=diff
==============================================================================
---
incubator/npanday/trunk/components/dotnet-core/src/main/java/npanday/PathUtil.java
(original)
+++
incubator/npanday/trunk/components/dotnet-core/src/main/java/npanday/PathUtil.java
Sat Aug 20 21:52:07 2011
@@ -304,7 +304,13 @@ public final class PathUtil
if (executablePath == null || !executablePath.exists())
return null;
- File executableFile = new File(executablePath, executable);
+ File executableFile = new File(executable);
+ if (executableFile.isAbsolute())
+ {
+ executablePath = executableFile.getParentFile();
+ executable = executableFile.getName();
+ }
+
if (executableFile.exists())
return executableFile;