From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5273 invoked from network); 25 Nov 2008 00:07:03 -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; 25 Nov 2008 00:07:03 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 11914 invoked from network); 25 Nov 2008 00:06:56 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 25 Nov 2008 00:06:56 -0000 Received: (qmail 29656 invoked by alias); 25 Nov 2008 00:06:50 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 26089 Received: (qmail 29638 invoked from network); 25 Nov 2008 00:06:49 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 25 Nov 2008 00:06:49 -0000 Received: from nex.scrapping.cc (nex.scrapping.cc [89.149.209.203]) by bifrost.dotsrc.org (Postfix) with ESMTP id 9E8E380525B4 for ; Tue, 25 Nov 2008 01:06:46 +0100 (CET) Received: from localhost (manz-590ee386.pool.einsundeins.de [89.14.227.134]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by nex.scrapping.cc (Postfix) with ESMTPSA id 0344828C844 for ; Tue, 25 Nov 2008 01:06:45 +0100 (CET) Date: Tue, 25 Nov 2008 01:05:37 +0100 From: Jonas Kramer To: zsh-workers@sunsite.dk Subject: Seg. Fault when calling "cd" with set "chpwd" hook from a widget Message-ID: <20081125000535.GC30055@unknown> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="H8ygTp4AXg6deix2" Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) X-Virus-Scanned: ClamAV 0.92.1/8676/Mon Nov 24 20:12:57 2008 on bifrost X-Virus-Status: Clean --H8ygTp4AXg6deix2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi workers, I've experienced a seg. fault in zsh when doing the following: This is the widget: # Control + B jumps to "base" directory. function return-to-base; { if [[ ! -z "$BASE" ]]; then [[ -d "$BASE" ]] && cd "$BASE" zle reset-prompt fi } It's bound to key ^b. Here's the chpwd function: 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" } 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. I tried to fix it myself, but I can't find a clean solution as I can't find the source of the problem. Just checking for hptr being NULL in hend() would just fix the symptom, not the cause I guess. Regards, Jonas --=20 --H8ygTp4AXg6deix2 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) iEYEARECAAYFAkkrQU8ACgkQGtAEtVIPC06UJgCfTFa1HSIFlOecQ533q4ZcBnz7 1YsAnjyFzAbVEt97cQYUeNNJZxVu0NpD =Tu+7 -----END PGP SIGNATURE----- --H8ygTp4AXg6deix2--