Skip to content

Commit

Permalink
mojohaus#42, Execution of Windows executables broken in 1.5.0
Browse files Browse the repository at this point in the history
no fast-success case for Windows
  • Loading branch information
Frank Jakop committed Jun 8, 2016
1 parent f97b99b commit 8534093
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/main/java/org/codehaus/mojo/exec/ExecMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -663,14 +663,15 @@ static String findExecutable( final String executable, final List<String> paths
search: for ( final String path : paths )
{
f = new File( path, executable );
for ( final String extension : getExecutableExtensions() )
{
f = new File( path, executable + extension );
if ( f.isFile() )
break search;
}
if ( f.isFile() )
break;
if ( !OS.isFamilyWindows() && f.isFile() )
break;
else
for ( final String extension : getExecutableExtensions() )
{
f = new File( path, executable + extension );
if ( f.isFile() )
break search;
}
}

if ( f == null || !f.exists() )
Expand Down

1 comment on commit 8534093

@mkarg
Copy link

@mkarg mkarg commented on 8534093 Jun 10, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm... what happens if I provide NOTEPAD.EXE on Windows? I think it will fail then...! :-(

Please sign in to comment.