From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gatech.edu (gatech.edu [130.207.244.244]) by werple.mira.net.au (8.6.12/8.6.9) with SMTP id BAA13254 for ; Sat, 8 Jul 1995 01:34:00 +1000 Received: from math (math.skiles.gatech.edu) by gatech.edu with SMTP id AA24337 (5.65c/Gatech-10.0-IDA for ); Fri, 7 Jul 1995 11:26:27 -0400 Received: by math (5.x/SMI-SVR4) id AA25418; Fri, 7 Jul 1995 11:22:53 -0400 Resent-Date: Fri, 7 Jul 1995 17:22:00 +0100 (MET DST) Old-Return-Path: From: hzoli@cs.elte.hu (Zoltan Hidvegi) Message-Id: <9507071522.AA15820@turan.elte.hu> Subject: Re: Bugfix: zsh crashes if invoked with unset PATH To: zsh-workers@math.gatech.edu (zsh-workers) Date: Fri, 7 Jul 1995 17:22:00 +0100 (MET DST) In-Reply-To: <9507050940.AA05399@turan.elte.hu> from "Zoltan Hidvegi" at Jul 5, 95 11:40:23 am X-Mailer: ELM [version 2.4 PL21] Content-Type: text Resent-Message-Id: <"G9p8r.0.0D6.B5L_l"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/174 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu I posted this a few days ago: > > If PATH is not set in the environment, zsh dumps core the first time it > attempts to execute an external command without an absolute path. That is > because in init.c newcmdnamtable() is called before the path is initialised. > > % unset PATH ; ./zsh -fc 'ls' > zsh: 5275 segmentation fault (core dumped) ./zsh -fc 'ls' > > Because of this bug one of my boot scripts faild (that's almost the only place > where PATH is unset). > > Here is the patch to fix that. It applies with fuzz 2 to the baseline zsh as I > added /usr/local/bin to the default path in my release. Unfortunately, I forgot to include the patch to fix that. It's funny that noone complained. Here it is now. Bye, Zoltan rcsdiff -qc -kk -r1.7 -r1.8 Src/init.c *** Src/init.c --- Src/init.c 1995/07/05 11:39:28 *************** *** 452,458 **** newreswdtable(); /* create hash table for reserved words */ newaliastable(); /* create hash table for aliases */ - newcmdnamtable(); /* create hash table for commands */ newcompctltable(); /* create hash table for compctls */ initxbindtab(); /* initialize key bindings */ --- 452,457 ---- *************** *** 542,548 **** path[3] = ztrdup("/usr/local/bin"); path[4] = NULL; ! inittyptab(); /* initialize the ztypes table */ initlextabs(); /* We cache the uid so we know when to * --- 541,548 ---- path[3] = ztrdup("/usr/local/bin"); path[4] = NULL; ! newcmdnamtable(); /* create hash table for commands */ ! inittyptab(); /* initialize the ztypes table */ initlextabs(); /* We cache the uid so we know when to *