+2010-06-08 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ Clarify OpenBSD sh errexit issue with compound commands.
+ * doc/autoconf.texi (Limitations of Builtins): Only the last
+ command in a compound list is problematic.
+ Tested on OpenBSD 4.4.
+
2010-06-07 Eric Blake <eblake@redhat.com>
Properly quote AC_PREREQ during autoupdate.
touch file'}, where the seemingly-unnecessary @samp{sh -c '@dots{}'}
wrapper works around the bug (@pxref{Failure in Make Rules}).
-Even relatively-recent versions of the BSD shell (e.g.,
-OpenBSD 3.4) wrongly exit with @option{-e} if a command within
-@samp{&&} fails inside a compound statement. For example:
+Even relatively-recent versions of the BSD shell (e.g., OpenBSD 3.4)
+wrongly exit with @option{-e} if the last command within a compound
+statement fails and is guarded by an @samp{&&} only. For example:
@example
#! /bin/sh
echo one
if :; then
test -n "$foo" && exit 1
+ echo two
+ test -n "$foo" && exit 1
fi
-echo two
+echo three
@end example
@noindent
-does not print @samp{two}. One workaround is to use @samp{if test -n
-"$foo"; then exit 1; fi} rather than @samp{test -n "$foo" && exit 1}.
-Another possibility is to warn BSD users not to use @samp{sh -e}.
+does not print @samp{three}. One workaround is to change the last
+instance of @samp{test -n "$foo" && exit 1} to be @samp{if test -n
+"$foo"; then exit 1; fi} instead. Another possibility is to warn BSD
+users not to use @samp{sh -e}.
When @samp{set -e} is in effect, a failed command substitution in
Solaris @command{/bin/sh} cannot be ignored, even with @samp{||}.