init.sh: avoid unnecessary shell re-exec
authorJim Meyering <meyering@redhat.com>
Sun, 16 May 2010 16:34:08 +0000 (18:34 +0200)
committerJim Meyering <meyering@redhat.com>
Sun, 16 May 2010 17:08:38 +0000 (19:08 +0200)
commitcfa7f85bf1b1b1dcb51b27dc615f85e62710c056
tree0faaaa1a7f174c100d89d18a102425fc04a6356d
parenta43e24168368619e2d51fe7a37abc4969d7a87fe
init.sh: avoid unnecessary shell re-exec

* tests/init.sh: Improve the re-exec-required check to first test the
current shell.  If it passes the test, do not search for a shell that
does pass, and do not re-exec.  This test is particularly contorted to
avoid triggering misbehavior in Solaris 10's /bin/sh whereby any use
of $(...) evokes a syntax error and causes immediate shell exit with
status 2.  Bruno Haible reported that the re-exec made it impossible
to single-step through any init.sh-using script.
ChangeLog
tests/init.sh