From: Chet Ramey Date: Tue, 13 Mar 2012 19:12:07 +0000 (-0400) Subject: Bash-4.2 patch 23 X-Git-Tag: bash-4.3~24 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=98043138fc04542cf96d54c778949aa92cd505bd;p=thirdparty%2Fbash.git Bash-4.2 patch 23 --- diff --git a/error.c b/error.c index 72da9f540..1eac01c4a 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 9166366b3..3ef48b5ac 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 df25f632a..9feaa9c2b 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);