diff options
author | Chet Ramey <chet.ramey@case.edu> | 2015-05-19 14:55:02 -0400 |
---|---|---|
committer | Chet Ramey <chet.ramey@case.edu> | 2015-05-19 14:55:02 -0400 |
commit | 8daea13bac899cd26856747cbe836d0dce594d75 (patch) | |
tree | a22151582bebaa101ade9df062b27cec4d99c21b /builtins/set.def | |
parent | 84c617ecf0f06d4df1c3951504bb0d668c990e58 (diff) | |
download | bash-8daea13bac899cd26856747cbe836d0dce594d75.tar.gz |
Bash-4.3 patch 34
Diffstat (limited to 'builtins/set.def')
-rw-r--r-- | builtins/set.def | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/builtins/set.def b/builtins/set.def index c4a7001d..9fbbca14 100644 --- a/builtins/set.def +++ b/builtins/set.def @@ -751,9 +751,11 @@ unset_builtin (list) WORD_LIST *list; { int unset_function, unset_variable, unset_array, opt, nameref, any_failed; + int global_unset_func, global_unset_var; char *name; unset_function = unset_variable = unset_array = nameref = any_failed = 0; + global_unset_func = global_unset_var = 0; reset_internal_getopt (); while ((opt = internal_getopt (list, "fnv")) != -1) @@ -761,10 +763,10 @@ unset_builtin (list) switch (opt) { case 'f': - unset_function = 1; + global_unset_func = 1; break; case 'v': - unset_variable = 1; + global_unset_var = 1; break; case 'n': nameref = 1; @@ -777,7 +779,7 @@ unset_builtin (list) list = loptend; - if (unset_function && unset_variable) + if (global_unset_func && global_unset_var) { builtin_error (_("cannot simultaneously unset a function and a variable")); return (EXECUTION_FAILURE); @@ -795,6 +797,9 @@ unset_builtin (list) name = list->word->word; + unset_function = global_unset_func; + unset_variable = global_unset_var; + #if defined (ARRAY_VARS) unset_array = 0; if (!unset_function && valid_array_reference (name)) |