7
Bug-Reported-by: Ewan Mellor <Ewan.Mellor@eu.citrix.com>
8
Bug-Reference-ID: <6005BE083BF501439A84DC3523BAC82DC4B964FD12@LONPMAILBOX01.citrite.net>
13
Under some circumstances, an exit trap triggered by a bad substitution
14
error when errexit is enabled will cause the shell to exit with an
15
incorrect exit status (0).
18
===================================================================
24
if (exit_immediately_on_error)
27
+ if (last_command_exit_value == 0)
28
+ last_command_exit_value = 1;
29
+ exit_shell (last_command_exit_value);
34
Index: b/bash/patchlevel.h
35
===================================================================
36
--- a/bash/patchlevel.h
37
+++ b/bash/patchlevel.h
39
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
40
looks for to find the patch level (for the sccs version string). */
42
-#define PATCHLEVEL 22
43
+#define PATCHLEVEL 23
45
#endif /* _PATCHLEVEL_H_ */
47
===================================================================
54
+ last_command_exit_value = EXECUTION_FAILURE;
55
report_error (_("%s: bad substitution"), string ? string : "??");