depot/pkgs/shells/bash/fix-pop-var-context-error.patch
Luke Granger-Brown 57725ef3ec Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce
git-subtree-dir: third_party/nixpkgs
git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
2024-11-10 23:59:47 +00:00

17 lines
676 B
Diff

Excerpted from <https://git.savannah.gnu.org/cgit/bash.git/commit/?h=devel&id=055a4552c901e43e6a6007f5bc664a33698dbf85>.
Original author: Chet Ramey <chet.ramey@case.edu>
--- variables.c
+++ 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;
}