From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27877 invoked from network); 30 Nov 2008 11:01:16 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 30 Nov 2008 11:01:16 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 86354 invoked from network); 30 Nov 2008 11:01:07 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 30 Nov 2008 11:01:07 -0000 Received: (qmail 15432 invoked by alias); 30 Nov 2008 11:01:02 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 26099 Received: (qmail 15418 invoked from network); 30 Nov 2008 11:01:01 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 30 Nov 2008 11:01:01 -0000 Received: from nex.scrapping.cc (nex.scrapping.cc [89.149.209.203]) by bifrost.dotsrc.org (Postfix) with ESMTP id BDB1D80525B6 for ; Sun, 30 Nov 2008 12:00:56 +0100 (CET) Received: from localhost (manz-590eed84.pool.einsundeins.de [89.14.237.132]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by nex.scrapping.cc (Postfix) with ESMTPSA id 90E0228C857; Sun, 30 Nov 2008 12:00:55 +0100 (CET) Date: Sun, 30 Nov 2008 11:59:31 +0100 From: Jonas Kramer To: Bart Schaefer Cc: zsh-workers@sunsite.dk Subject: Re: Seg. Fault when calling "cd" with set "chpwd" hook from a widget Message-ID: <20081130105931.GA29769@unknown> References: <20081125000535.GC30055@unknown> <081129203135.ZM6271@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="uAKRQypu60I7Lcqm" Content-Disposition: inline In-Reply-To: <081129203135.ZM6271@torch.brasslantern.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Virus-Scanned: ClamAV 0.92.1/8697/Sun Nov 30 05:43:56 2008 on bifrost X-Virus-Status: Clean --uAKRQypu60I7Lcqm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Nov 29, 2008 at 08:31:35PM -0800, Bart Schaefer wrote: > On Nov 25, 1:05am, Jonas Kramer wrote: > > > > # Control + B jumps to "base" directory. > > function return-to-base; { >=20 > Not directly pertinent, but what's the semicolon for? Now that you ask, I don't know. I guess I'm just used to it. >=20 > > function chpwd; { > > DIRECTORY=3D"$PWD" > > while true; do > > if [ -f './.env.rc' ]; then > > source './.env.rc' > > break > > fi > > if [ -f './env' ]; then > > source './env' > > break > > fi > > [ $PWD =3D '/' ] && break > > cd -q .. > > done > > cd -q "$DIRECTORY" > > } > >=20 > > Now when BASE points to a directory that contains a .env.rc file and I > > press ^B, it seems to work fine at first, the directory is updated and I > > get a new nice prompt. But then, no matter what I enter, after hitting > > return zsh crashes with a seg. fault. This seems to happen in > > hist.c:1138, where hptr points to NULL at that point. >=20 > Are there any commands in ./.env.rc or ./env that manipulate the history? I don't know if commands executed in a chpwd hook function are added to the history (they shouldn't in my oppinion), but I'm not explicitly changing it in there. This is a sample .env.rc I'm using in a project: # vim:filetype=3Dzsh export BASE=3D$PWD export PERL5LIB=3D"$PWD/code/" /usr/bin/ctags --languages=3D"Perl" -R "$PWD" Regards, Jonas --=20 --uAKRQypu60I7Lcqm Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) iEYEARECAAYFAkkychMACgkQGtAEtVIPC06AhQCffOUp0LBolMh3nOO12DRplLGP m4cAnA6GHe+AKbRw32pSOSG0OCEJR4nr =lj8Q -----END PGP SIGNATURE----- --uAKRQypu60I7Lcqm--