aboutsummaryrefslogtreecommitdiffstats
path: root/error.c
diff options
context:
space:
mode:
Diffstat (limited to 'error.c')
-rw-r--r--error.c6
1 files changed, 5 insertions, 1 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