[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Fix buglet in code searching for a good shell (tests/init.sh
From: |
Jim Meyering |
Subject: |
Re: [PATCH] Fix buglet in code searching for a good shell (tests/init.sh). |
Date: |
Fri, 11 Jun 2010 13:02:11 +0200 |
Stefano Lattarini wrote:
> The attached patch fixes a minor wart in the `tests/init.sh' shell
> library. IMO it is simple enough not to require a copyright
> assigement for gnulib (which I don't have).
>
> * tests/init.sh: Do not use `$ME_' and `skip_' before they are
> defined.
...
Hi Stefano,
Thanks for the report and fixes.
> test-sys_socket: avoid set-but-not-used warnings from gcc
> diff --git a/tests/init.sh b/tests/init.sh
> index ef0957c..4eb4a95 100644
> --- a/tests/init.sh
> +++ b/tests/init.sh
> @@ -97,12 +97,15 @@ else
> for re_shell_ in "${CONFIG_SHELL:-no_shell}" /bin/sh bash dash zsh pdksh
> fail
> do
> test "$re_shell_" = no_shell && continue
> - test "$re_shell_" = fail && skip_ failed to find an adequate shell
> + if test "$re_shell_" = fail; then
> + echo "$0: skipped test: failed to find an adequate shell" 1>&2
> + exit 77
Did you deliberately choose not to use the "(exit 77); exit 77"
idiom from Exit()? If so, why?
The "set +e" part matters less to me.
Did you consider simply hoisting the definitions
of Exit and/or ME_ to precede their first use?
> + fi
> "$re_shell_" -c "$gl_shell_test_script_" 2>/dev/null
> if test $? = 9; then
> # Found an acceptable shell.
> exec "$re_shell_" "$0" --no-reexec "$@"
> - echo "$ME_: exec failed" 1>&2
> + echo "$0: exec failed" 1>&2
> exit 127
> fi
> done