aboutsummaryrefslogtreecommitdiffstats
path: root/subst.c
diff options
context:
space:
mode:
Diffstat (limited to 'subst.c')
-rw-r--r--subst.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/subst.c b/subst.c
index 17653cc..4331f11 100644
--- a/subst.c
+++ b/subst.c
@@ -9561,7 +9561,14 @@ shell_expand_word_list (tlist, eflags)
opts[opti] = '\0';
if (opti > 0)
- make_internal_declare (tlist->word->word, opts);
+ {
+ t = make_internal_declare (tlist->word->word, opts);
+ if (t != EXECUTION_SUCCESS)
+ {
+ last_command_exit_value = t;
+ exp_jump_to_top_level (DISCARD);
+ }
+ }
t = do_word_assignment (tlist->word, 0);
if (t == 0)