diff options
author | Chet Ramey <chet.ramey@case.edu> | 2015-05-19 14:55:02 -0400 |
---|---|---|
committer | Tom Powell <zifnab@zifnab06.net> | 2015-10-08 20:51:50 -0700 |
commit | ec1364fb33cd9a221649eeb362e00a2cfa4a66c1 (patch) | |
tree | b6a114d2d8bc98b274fb5884cedbc964cc36a690 /builtins/set.def | |
parent | bbc8b4849e0921dc4d9742359ca37f527712eccd (diff) | |
download | android_external_bash-ec1364fb33cd9a221649eeb362e00a2cfa4a66c1.tar.gz android_external_bash-ec1364fb33cd9a221649eeb362e00a2cfa4a66c1.tar.bz2 android_external_bash-ec1364fb33cd9a221649eeb362e00a2cfa4a66c1.zip |
Bash-4.3 patch 34
Change-Id: I4dbb5273a0372ab63d342a11dc9c9d19c002a9ac
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 c4a7001..9fbbca1 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)) |