autoconf/lib/autotest
Eric Blake 0eebfff3e0 m4sh: avoid // issues in _AS_PATH_WALK
As reported by Paul Keir on the cygwin lists,
http://cygwin.com/ml/cygwin/2012-07/msg00263.html,
some people like to stick / in their $PATH, and if we then try
to probe $as_dir/progname for existence, we can end up causing
cygwin to have a several-second timeout per //name probe.  It
is better to avoid inserting the extra slash when $as_dir is the
root directory, and simpler to code by always having a trailing
slash present than it is to strip a trailing slash.  Thankfully,
_AS_PATH_WALK is an undocumented interface, and even if someone
was using it in spite of the warnings, their use of $as_dir/foo
will typically only lead to odd-looking /dir//foo probes, with
only the case of / in $PATH causing slowdowns, and only when //
is special.

There was also a minor bug where the if-not-found code of
_AS_PATH_WALK could be executed with $IFS still in the wrong state.

* lib/m4sugar/m4sh.m4 (_AS_PATH_WALK): Always end as_dir in /.
Avoid wrong IFS during if-not-found.  Minor optimization to avoid
regex.
(_AS_DETECT_BETTER_SHELL, _AS_SHELL_SANITIZE): Update clients.
* lib/autotest/general.m4 (_AT_FINISH): Likewise.
* lib/autoconf/programs.m4 (_AC_CHECK_PROG, _AC_PATH_PROG)
(_AC_PATH_PROGS_FEATURE_CHECK, _AC_PATH_PROG_FLAVOR_GNU): Likewise.
2012-07-13 11:33:13 -06:00
..
autotest.m4 maint: update copyright year 2012-01-04 00:20:24 -08:00
general.m4 m4sh: avoid // issues in _AS_PATH_WALK 2012-07-13 11:33:13 -06:00
Makefile.am maint: update copyright year 2012-01-04 00:20:24 -08:00
specific.m4 maint: update copyright year 2012-01-04 00:20:24 -08:00