Skip to content

Commit

Permalink
Make sure that the result FilePaths.findExe() is not a directory
Browse files Browse the repository at this point in the history
(this happened to me for /opt/homebrew/opt/java which was found
but is a directory)
  • Loading branch information
tpietzsch committed Apr 17, 2024
1 parent 841ecca commit 2c616f7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/org/apposed/appose/FilePaths.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public static File findExe(List<String> dirs, List<String> exes) {
// Candidate is a relative path; check beneath each given directory.
for (String dir : dirs) {
File f = Paths.get(dir, exe).toFile();
if (f.canExecute()) return f;
if (f.canExecute() && !f.isDirectory()) return f;
}
}
}
Expand Down

0 comments on commit 2c616f7

Please sign in to comment.