#42 Seg. fault in chpwd hook in a widget

open-fixed
ZLE (6)
5
2009-03-09
2008-11-24
Anonymous
No

I have a widget in which "cd" is called, and a chpwd function that does some things. When I call "cd" in the widget without -q, so the hook is called, zsh exits with a seg. fault.

Here's the widget:
---------------------
# Control + B jumps to "base" directory.
function return-to-base; {
if [[ ! -z "$BASE" ]]; then
[[ -d "$BASE" ]] && cd "$BASE"
zle reset-prompt
fi
}
----------------------

And here's the chpwd callback:

----------------------
function chpwd; {
DIRECTORY="$PWD"
while true; do
if [ -f './.env.rc' ]; then
source './.env.rc'
break
fi
if [ -f './env' ]; then
source './env'
break
fi
[ $PWD = '/' ] && break
cd -q ..
done
cd -q "$DIRECTORY"
}
----------------------

---------------------
[jkramer/unknown:~]# zsh --version
zsh 4.3.9 (i686-pc-linux-gnu)
[jkramer/unknown:~]# zsh
[jkramer/unknown:~]# # Pressing the hotkey for the widget now.
[jkramer/unknown:~]#
[jkramer/unknown:~]#
[jkramer/unknown:~]# cd work/allianz/trunk/bll/site_perl
[jkramer/unknown:.../trunk]#
zsh: segmentation fault zsh
---------------------

Discussion

    • assigned_to: nobody --> pws
     
    • status: open --> open-fixed
     
  • Believed understood and fixed by the patch zsh-workers/26702 on the zsh-workers mailing list.

     
  • AgMwPn <a href="http://pxkisihjamqc.com/">pxkisihjamqc</a>, [url=http://zwhztpkipddj.com/]zwhztpkipddj[/url], [link=http://wyqpflcqsogt.com/]wyqpflcqsogt[/link], http://nsyqtzezyrhe.com/