diff options
author | Peter Stephenson <pws@zsh.org> | 2015-10-06 09:28:07 +0100 |
---|---|---|
committer | Peter Stephenson <pws@zsh.org> | 2015-10-06 09:28:07 +0100 |
commit | 83a175795a444e8169fcb592a110d4d15a09b907 (patch) | |
tree | ded4925ccaeca3c4f94176565a1444caa1cc176b | |
parent | 3f9606333578384221948e285ed896738071b253 (diff) | |
download | zsh-83a175795a444e8169fcb592a110d4d15a09b907.tar.gz zsh-83a175795a444e8169fcb592a110d4d15a09b907.tar.xz zsh-83a175795a444e8169fcb592a110d4d15a09b907.zip |
36780: Fix crash in ksh mode with -n and $HOME.
If home variable is NULL ensure HOME is unset.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | Src/params.c | 13 |
2 files changed, 12 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog index e1f58c9ae..6369cf6e9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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 diff --git a/Src/params.c b/Src/params.c index de151a4cd..a8abb289e 100644 --- a/Src/params.c +++ b/Src/params.c @@ -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); |