[1.0 release prep] Block namespace defs in ksh functions
In 93v-/ksh2020, namespace defs in any function are a syntax error. This commit blocks namespace defs for ksh functions only, at the execution level. This follows some of AT&T original intention while working around some of the known bugs with namespaces. Related: https://github.com/ksh93/ksh/issues/325
This commit is contained in:
parent
e3d91ffa90
commit
40de1e92b0
|
|
@ -2481,6 +2481,11 @@ int sh_exec(register const Shnode_t *t, int flags)
|
|||
errormsg(SH_DICT,ERROR_exit(1),e_ident,fname);
|
||||
UNREACHABLE();
|
||||
}
|
||||
if(shp->st.real_fun)
|
||||
{
|
||||
error(ERROR_exit(3),"namespaces cannot be defined in a ksh function scope");
|
||||
UNREACHABLE();
|
||||
}
|
||||
sfputc(stkp,'.');
|
||||
sfputr(stkp,fname,0);
|
||||
np = nv_open(stkptr(stkp,offset),shp->var_tree,flags);
|
||||
|
|
|
|||
Loading…
Reference in New Issue