7 Bug-Reported-by: Dreamcat4 <dreamcat4@gmail.com>
8 Bug-Reference-ID: <CAN39uTpAEs2GFu4ebC_SfSVMRTh-DJ9YanrY4BZZ3OO+CCHjng@mail.gmail.com>
9 Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2015-05/msg00001.html
13 If neither the -f nor -v options is supplied to unset, and a name argument is
14 found to be a function and unset, subsequent name arguments are not treated as
15 variables before attempting to unset a function by that name.
17 Patch (apply with `patch -p0'):
19 --- a/builtins/set.def
20 +++ b/builtins/set.def
21 @@ -751,9 +751,11 @@ unset_builtin (list)
24 int unset_function, unset_variable, unset_array, opt, nameref, any_failed;
25 + int global_unset_func, global_unset_var;
28 unset_function = unset_variable = unset_array = nameref = any_failed = 0;
29 + global_unset_func = global_unset_var = 0;
31 reset_internal_getopt ();
32 while ((opt = internal_getopt (list, "fnv")) != -1)
33 @@ -761,10 +763,10 @@ unset_builtin (list)
38 + global_unset_func = 1;
42 + global_unset_var = 1;
46 @@ -777,7 +779,7 @@ unset_builtin (list)
50 - if (unset_function && unset_variable)
51 + if (global_unset_func && global_unset_var)
53 builtin_error (_("cannot simultaneously unset a function and a variable"));
54 return (EXECUTION_FAILURE);
55 @@ -795,6 +797,9 @@ unset_builtin (list)
57 name = list->word->word;
59 + unset_function = global_unset_func;
60 + unset_variable = global_unset_var;
62 #if defined (ARRAY_VARS)
64 if (!unset_function && valid_array_reference (name))
68 regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
69 looks for to find the patch level (for the sccs version string). */
71 -#define PATCHLEVEL 33
72 +#define PATCHLEVEL 34
74 #endif /* _PATCHLEVEL_H_ */