From 98043138fc04542cf96d54c778949aa92cd505bd Mon Sep 17 00:00:00 2001 From: Chet Ramey Date: Tue, 13 Mar 2012 15:12:07 -0400 Subject: [PATCH] Bash-4.2 patch 23 --- error.c | 6 +++++- patchlevel.h | 2 +- subst.c | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/error.c b/error.c index 72da9f5..1eac01c 100644 --- a/error.c +++ b/error.c @@ -200,7 +200,11 @@ report_error (format, va_alist) va_end (args); if (exit_immediately_on_error) - exit_shell (1); + { + if (last_command_exit_value == 0) + last_command_exit_value = 1; + exit_shell (last_command_exit_value); + } } void diff --git a/patchlevel.h b/patchlevel.h index 9166366..3ef48b5 100644 --- a/patchlevel.h +++ b/patchlevel.h @@ -25,6 +25,6 @@ regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh looks for to find the patch level (for the sccs version string). */ -#define PATCHLEVEL 22 +#define PATCHLEVEL 23 #endif /* _PATCHLEVEL_H_ */ diff --git a/subst.c b/subst.c index df25f63..9feaa9c 100644 --- a/subst.c +++ b/subst.c @@ -7274,6 +7274,7 @@ parameter_brace_expand (string, indexp, quoted, pflags, quoted_dollar_atp, conta default: case '\0': bad_substitution: + last_command_exit_value = EXECUTION_FAILURE; report_error (_("%s: bad substitution"), string ? string : "??"); FREE (value); FREE (temp); -- 2.7.4