aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChet Ramey <chet.ramey@case.edu>2012-03-13 15:12:07 -0400
committerChet Ramey <chet.ramey@case.edu>2012-03-13 15:12:07 -0400
commit98043138fc04542cf96d54c778949aa92cd505bd (patch)
tree0deb3d2c6751a0ad7d3aa2a9c61be90e9744a3eb
parentea6616c01e453e5536308bf32fc37598f9c06950 (diff)
downloadandroid_external_bash-98043138fc04542cf96d54c778949aa92cd505bd.tar.gz
android_external_bash-98043138fc04542cf96d54c778949aa92cd505bd.tar.bz2
android_external_bash-98043138fc04542cf96d54c778949aa92cd505bd.zip
Bash-4.2 patch 23
-rw-r--r--error.c6
-rw-r--r--patchlevel.h2
-rw-r--r--subst.c1
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);