1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-28 17:10:59 +01:00

47704: fix scope for "private -p"

This commit is contained in:
Bart Schaefer 2020-12-02 20:14:45 -08:00
parent d394bb2277
commit 3499a676fa
2 changed files with 8 additions and 0 deletions

View file

@ -171,6 +171,7 @@ bin_private(char *nam, char **args, LinkList assigns, Options ops, int func)
{
int from_typeset = 1;
int ofake = fakelevel; /* paranoia in case of recursive call */
int hasargs = *args != NULL || (assigns && firstnode(assigns));
makeprivate_error = 0;
if (!OPT_ISSET(ops, 'P')) {
@ -190,6 +191,9 @@ bin_private(char *nam, char **args, LinkList assigns, Options ops, int func)
}
ops->ind['g'] = 2; /* force bin_typeset() to behave as "local" */
if (OPT_ISSET(ops, 'p') || (!hasargs && OPT_ISSET(ops, '+'))) {
return bin_typeset("private", args, assigns, ops, func);
}
queue_signals();
fakelevel = locallevel;