-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Eric Blake on 11/17/2009 6:01 AM: >> The following patch should resolve this -- really all it does is preface a >> "/" into the path tested, so that (ie AT_TESTED(@BZCAT@) where BZCAT is >> /usr/bin/bzcat) the path "/" is tested, checking ///usr/bin/bzcat, before >> testing /bin, checking /bin/usr/bin/bzcat. > > Nice idea. However, it adds the potential for false positives. A better > patch would be to check for an absolute name prior to starting the loop > over PATH. I'll work up a patch along those lines.
Here's what I'm pushing. - -- Don't work too hard, make some time for fun as well! Eric Blake e...@byu.net -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAksHGBsACgkQ84KuGfSFAYAJPQCgiHXvOvJ+eX1GFMyB30ZLhYYA pScAnii7wlzgGlm13puEjtUaBB4Udohw =q9yQ -----END PGP SIGNATURE-----
>From 67a98580abc3e471dc946c1c01e30ed783e8bbc8 Mon Sep 17 00:00:00 2001 From: Eric Blake <e...@byu.net> Date: Fri, 20 Nov 2009 15:19:50 -0700 Subject: [PATCH] Allow absolute names in AT_TESTED. * lib/autotest/general.m4 (AT_INIT) <PREPARE_TESTS>: Check for absolute names before path walk. * THANKS: Update. Suggested by Allan Clark. Signed-off-by: Eric Blake <e...@byu.net> --- ChangeLog | 7 +++++++ lib/autotest/general.m4 | 13 +++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 77e9d4e..21c4ffc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-11-20 Eric Blake <e...@byu.net> + + * lib/autotest/general.m4 (AT_INIT) <PREPARE_TESTS>: Allow + absolute names for AT_TESTED. + * THANKS: Update. + Suggested by Allan Clark. + 2009-11-09 Eric Blake <e...@byu.net> Fix AC_FUNC_MMAP for cygwin. diff --git a/lib/autotest/general.m4 b/lib/autotest/general.m4 index 33218fd..6e43879 100644 --- a/lib/autotest/general.m4 +++ b/lib/autotest/general.m4 @@ -967,11 +967,16 @@ m4_divert_push([PREPARE_TESTS])dnl for at_program in : $at_tested do test "$at_program" = : && continue - _AS_PATH_WALK([$PATH], [test -f "$as_dir/$at_program" && break]) - if test -f "$as_dir/$at_program"; then + case $at_program in + [[\\/]* | ?:[\\/]* ) $at_program_=$at_program ;;] + * ) + _AS_PATH_WALK([$PATH], [test -f "$as_dir/$at_program" && break]) + at_program_=$as_dir/$at_program ;; + esac + if test -f "$at_program_"; then { - AS_ECHO(["$at_srcdir/AT_LINE: $as_dir/$at_program --version"]) - "$as_dir/$at_program" --version </dev/null + AS_ECHO(["$at_srcdir/AT_LINE: $at_program_ --version"]) + "$at_program_" --version </dev/null echo } >&AS_MESSAGE_LOG_FD 2>&1 else -- 1.6.5.rc1