Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: $HOME not set and zsh crashing in emulation mode



Paulo César Pereira de Andrade wrote on Thu, Oct 27, 2016 at 15:51:43 -0200:
>   A simple reproducer:
> 
> """
> $ cat t.sh
> #!/bin/sh
> echo $HOME
> 
> $ ln -sf /bin/zsh ksh
> 
> $ ./ksh -n t.sh
> Segmentation fault (core dumped)
> """

You're using 5.0.2, which is four years old.  We've fixed this bug in
5.2 last year:

    commit 83a175795a444e8169fcb592a110d4d15a09b907
    Author: Peter Stephenson <pws@xxxxxxx>
    Date:   Tue Oct 6 09:28:07 2015 +0100
    
        36780: Fix crash in ksh mode with -n and $HOME.
        
        If home variable is NULL ensure HOME is unset.

Current master does not have the problem:

% ARGV0=ksh Src/zsh -fn =(<<<$'#!/bin/sh\necho $HOME\n') 
% 

Thanks for the bug report and the patch.

Cheers,

Daniel



Messages sorted by: Reverse Date, Date, Thread, Author