[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: |
Stefano Lattarini |
Subject: |
Re: [PATCH] Fix buglet in code searching for a good shell (tests/init.sh). |
Date: |
Fri, 11 Jun 2010 13:18:14 +0200 |
User-agent: |
KMail/1.12.1 (Linux/2.6.30-2-686; KDE/4.3.4; i686; ; ) |
At Friday 11 June 2010, Jim Meyering wrote:
> > 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?
I thought the '(exit ...); exit ...' idiom to be necessary only when
an exit trap is in place, to ensure that the code in the trap is
passed the correct exit status in $?. Did I miss something?
> Did you consider simply hoisting the definitions
> of Exit and/or ME_ to precede their first use?
No, I just tried to fix the problem with the minimal amount of changes.
Anyway, the absence of a decent shell and the failure of the exec call
are very very unlikely situations, so IMHO it's not a big deal if the
program name (`$0' instead of `$ME_') is suboptimal in the error
messages associated with those situations.
Of course, feel free to edit my changes as you see fit.
Thanks for your review,
Stefano