# --- T2-COPYRIGHT-NOTE-BEGIN --- # T2 SDE: package/*/bash/no-pop-var-context.patch # Copyright (C) 2023 The T2 SDE Project # # This Copyright note is generated by scripts/Create-CopyPatch, # more information can be found in the files COPYING and README. # # This patch file is dual-licensed. It is available under the license the # patched project is licensed under, as long as it is an OpenSource license # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms # of the GNU General Public License version 2 as used by the T2 SDE. # --- T2-COPYRIGHT-NOTE-END --- Removes a warning when Build-Pkg fails. Extracted from https://git.savannah.gnu.org/cgit/bash.git/commit/?h=devel&id=055a4552c901e43e6a6007f5bc664a33698dbf85 See https://mail.gnu.org/archive/html/bug-bash/2022-10/msg00078.html - NoTag diff --git a/variables.c b/variables.c index 1a0c2c4..84af3c6 100644 --- a/variables.c +++ b/variables.c @@ -5413,7 +5413,9 @@ pop_var_context () vcxt = shell_variables; if (vc_isfuncenv (vcxt) == 0) { - internal_error (_("pop_var_context: head of shell_variables not a function context")); + /* If we haven't flushed all of the local contexts already, flag an error */ + if (shell_variables != global_variables || variable_context > 0) + internal_error (_("pop_var_context: head of shell_variables not a function context")); return; }