From: Stefano Lattarini Date: Fri, 22 Jun 2012 22:12:08 +0000 (+0200) Subject: tests: avoid one last `...` command substitution in 'test-init.sh' X-Git-Tag: v1.12.2~53 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5898641fb97b63ff62d84eed90ea7e1b2329bfe8;p=thirdparty%2Fautomake.git tests: avoid one last `...` command substitution in 'test-init.sh' * t/ax/test-init.sh (me): In the definition of this variable. This also shave off a couple of forks, and the need for a sanity check only required in fringe situations. Signed-off-by: Stefano Lattarini --- diff --git a/t/ax/test-init.sh b/t/ax/test-init.sh index ca606b54d..116d4b1b2 100644 --- a/t/ax/test-init.sh +++ b/t/ax/test-init.sh @@ -26,10 +26,13 @@ set -e # Test scripts can override it if they need to (but this should # be done carefully). if test -z "$me"; then - # Guard against failure to spawn sed (seen on MSYS), or empty $argv0. - me=`echo "$argv0" | sed -e 's,.*[\\/],,;s/\.sh$//;s/\.tap$//'` \ - && test -n "$me" \ - || { echo "$argv0: failed to define \$me" >&2; exit 99; } + # Strip all directory components. + me=${argv0##*/} + # Strip test suffix. + case $me in + *.tap) me=${me%.tap};; + *.sh) me=${me%.sh} ;; + esac fi