1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-02 22:11:54 +02:00

36780: Fix crash in ksh mode with -n and $HOME.

If home variable is NULL ensure HOME is unset.
This commit is contained in:
Peter Stephenson 2015-10-06 09:28:07 +01:00
parent 3f96063335
commit 83a175795a
2 changed files with 12 additions and 6 deletions

View file

@ -1,3 +1,8 @@
2015-10-06 Peter Stephenson <p.stephenson@samsung.com>
* 36780: Src/params.c: ensure HOME parameter is unset if
corresponding internal variable is null.
2015-10-04 Barton E. Schaefer <schaefer@zsh.org>
* 36773: Src/utils.c: limit CORRECT / CORRECT_ALL to directory

View file

@ -775,17 +775,18 @@ createparamtable(void)
#endif
opts[ALLEXPORT] = oae;
/*
* For native emulation we always set the variable home
* (see setupvals()).
*/
pm = (Param) paramtab->getnode(paramtab, "HOME");
if (EMULATION(EMULATE_ZSH))
{
/*
* For native emulation we always set the variable home
* (see setupvals()).
*/
pm = (Param) paramtab->getnode(paramtab, "HOME");
pm->node.flags &= ~PM_UNSET;
if (!(pm->node.flags & PM_EXPORTED))
addenv(pm, home);
}
} else if (!home)
pm->node.flags |= PM_UNSET;
pm = (Param) paramtab->getnode(paramtab, "LOGNAME");
if (!(pm->node.flags & PM_EXPORTED))
addenv(pm, pm->u.str);