mirror of
https://github.com/duncs/clusterssh.git
synced 2025-07-03 18:03:23 +00:00
Improve binary search algorithm
If a directory of the same name is in the current directory, this preventing the search running. So, if the binary path is not fully qualified always search, and check to ensure it is a file that is found, rather than an executable directory. Thanks to Ian Marsh for the patch
This commit is contained in:
parent
214f5a6a71
commit
77e31c4a62
3 changed files with 7 additions and 2 deletions
|
@ -6,6 +6,10 @@
|
||||||
- Thanks to anonymous for the patch
|
- Thanks to anonymous for the patch
|
||||||
* Allow for long line continuation in config files with a backslash
|
* Allow for long line continuation in config files with a backslash
|
||||||
- Thanks to Mike Loseke for the patch
|
- Thanks to Mike Loseke for the patch
|
||||||
|
* Improve binary search to
|
||||||
|
- ignore directories of the same name, and
|
||||||
|
- always search for the binary if it is not fully qualified
|
||||||
|
- Thanks to Ian Marsh for the patch
|
||||||
|
|
||||||
2009-09-24 Duncan Ferguson <duncan_ferguson@user.sf.net> - v3.27
|
2009-09-24 Duncan Ferguson <duncan_ferguson@user.sf.net> - v3.27
|
||||||
|
|
||||||
|
|
1
THANKS
1
THANKS
|
@ -32,5 +32,6 @@ Stanislas Rouvelin
|
||||||
Sami Kerola
|
Sami Kerola
|
||||||
Kristian Lyngstol
|
Kristian Lyngstol
|
||||||
Mike Loseke
|
Mike Loseke
|
||||||
|
Ian Marsh
|
||||||
|
|
||||||
$Id$
|
$Id$
|
||||||
|
|
|
@ -307,7 +307,7 @@ sub find_binary($) {
|
||||||
|
|
||||||
logmsg( 2, "Looking for $binary" );
|
logmsg( 2, "Looking for $binary" );
|
||||||
my $path;
|
my $path;
|
||||||
if ( !-x $binary ) {
|
if ( !-x $binary || substr($binary, 0, 1) ne '/' ) {
|
||||||
|
|
||||||
# search the users $PATH and then a few other places to find the binary
|
# search the users $PATH and then a few other places to find the binary
|
||||||
# just in case $PATH isnt set up right
|
# just in case $PATH isnt set up right
|
||||||
|
@ -326,7 +326,7 @@ sub find_binary($) {
|
||||||
{
|
{
|
||||||
logmsg( 3, "Looking in $_" );
|
logmsg( 3, "Looking in $_" );
|
||||||
|
|
||||||
if ( -x $_ . '/' . $binary ) {
|
if ( -f $_ . '/' . $binary && -x $_ . '/' . $binary ) {
|
||||||
$path = $_ . '/' . $binary;
|
$path = $_ . '/' . $binary;
|
||||||
logmsg( 2, "Found at $path" );
|
logmsg( 2, "Found at $path" );
|
||||||
last;
|
last;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue