1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

'.': disable ksh function lookup in POSIX mode

POSIXly, '.' loads only files, not functions.

This only applies to '.', not 'source' (which is not in POSIX).

src/cmd/ksh93/bltins/misc.c: b_source():
- For ksh function lookup, add an additional check that we're not
  in POSIX mode and running the '.' (SYSDOT) builtin.
This commit is contained in:
Martijn Dekker 2021-11-24 09:10:25 +01:00
parent c0334e32a1
commit 214308f81e
5 changed files with 28 additions and 2 deletions

View file

@ -259,7 +259,7 @@ int b_dot_cmd(register int n,char *argv[],Shbltin_t *context)
{
/* check for KornShell style function first */
np = nv_search(script,shp->fun_tree,0);
if(np && is_afunction(np) && !nv_isattr(np,NV_FPOSIX))
if(np && is_afunction(np) && !nv_isattr(np,NV_FPOSIX) && !(sh_isoption(SH_POSIX) && shp->bltindata.bnode==SYSDOT))
{
if(!np->nvalue.ip)
{