From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: zsh-workers-request@euclid.skiles.gatech.edu Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by coral.primenet.com.au (8.7.6/8.7.3) with ESMTP id BAA08071 for ; Tue, 26 Nov 1996 01:40:26 +1100 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id JAA19054; Mon, 25 Nov 1996 09:33:17 -0500 (EST) Resent-Date: Mon, 25 Nov 1996 09:33:17 -0500 (EST) Message-Id: <199611251433.PAA22472@hydra.ifh.de> X-Authentication-Warning: hydra.ifh.de: Host pws@localhost didn't use HELO protocol To: zsh-workers@math.gatech.edu (Zsh hackers list) Subject: bug with empty path Date: Mon, 25 Nov 1996 15:33:28 +0100 From: Peter Stephenson Resent-Message-ID: <"79Xsj2.0.ef4.juQco"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/2471 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu The lines: path=() and PATH= have different effects: the first produces an empty path array, the second a path with one blank element. This turns up in the following: % cd /usr/bin % PATH= % ls % path=() % ls zsh: command not found: ls which doesn't strike me as right; both should use the current directory if there is no path. The only `nice' way I can see of doing it (without messing the arrays around) is handling a totally empty path the same way as a path with a single blank element. *** Src/exec.c.path Mon Nov 25 15:26:47 1996 --- Src/exec.c Mon Nov 25 15:28:12 1996 *************** *** 331,336 **** --- 331,341 ---- if (isgooderr(ee, *nn ? nn : "/")) eno = ee; } + if (!*path) { + ee = zexecve(arg0, argv); + if (isgooderr(ee, "")) + eno = ee; + } for (pp = path; *pp; pp++) if (!(*pp)[0] || ((*pp)[0] == '.' && !(*pp)[1])) { ee = zexecve(arg0, argv); -- Peter Stephenson Tel: +49 33762 77366 WWW: http://www.ifh.de/~pws/ Fax: +49 33762 77413 Deutches Electronen-Synchrotron --- Institut fuer Hochenergiephysik Zeuthen DESY-IfH, 15735 Zeuthen, Germany.