Author: jfallows
Date: Thu Aug 25 16:49:36 2011
New Revision: 1161636
URL: http://svn.apache.org/viewvc?rev=1161636&view=rev
Log:
Properly detect executable name without extension
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=1161636&r1=1161635&r2=1161636&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
Thu Aug 25 16:49:36 2011
@@ -307,15 +307,16 @@ public final class PathUtil
return null;
File executableFile = new File(executable);
+ if (executableFile.exists())
+ return executableFile;
+
+ // handle case where executable is actually absolute
if (executableFile.isAbsolute())
{
executablePath = executableFile.getParentFile();
executable = executableFile.getName();
}
- if (executableFile.exists())
- return executableFile;
-
// TODO: handle linux/mac ?
String[] extensions = new String[] {"exe", "com", "bat", "cmd"};