* doc/autoconf.texi (Limitations of Builtins) <trap>: Correct
the example.
Reported by Ralf Wildenhues.
Signed-off-by: Eric Blake <ebb9@byu.net>
2008-11-18 Eric Blake <ebb9@byu.net>
+ Update example to match actual Tru64 behavior.
+ * doc/autoconf.texi (Limitations of Builtins) <trap>: Correct
+ the example.
+ Reported by Ralf Wildenhues.
+
Add AS_SET_STATUS, make AS_EXIT more efficient.
* lib/m4sugar/m4sh.m4 (_AS_EXIT_PREPARE, AS_SET_STATUS): New
macros.
Portable scripts should not use @samp{set -e} if @command{trap} is used
to install an exit handler. This is because Tru64/OSF 5.1 @command{sh}
-enters the trap handler with the exit status of the command prior to the
-one that triggered the errexit handler:
+sometimes enters the trap handler with the exit status of the command
+prior to the one that triggered the errexit handler:
@example
-$ @kbd{bash -c 'trap '\''echo $?'\'' 0; set -e; false'}
-1
-$ @kbd{sh -c 'trap '\''echo $?'\'' 0; set -e; false'}
+$ @kbd{sh -ec 'trap '\''echo $?'\'' 0; false'}
0
+$ @kbd{sh -c 'set -e; trap '\''echo $?'\'' 0; false'}
+1
@end example
@noindent