From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16161 invoked from network); 17 Jan 1997 07:35:00 -0000 Received: from euclid.skiles.gatech.edu (list@130.207.146.50) by coral.primenet.com.au with SMTP; 17 Jan 1997 07:35:00 -0000 Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id CAA24395; Fri, 17 Jan 1997 02:36:51 -0500 (EST) Resent-Date: Fri, 17 Jan 1997 02:36:51 -0500 (EST) Message-Id: <199701170747.RAA23494@ogre.devetir.qld.gov.au> To: zsh-workers@math.gatech.edu cc: mckay@thehub.com.au Reply-To: mckay@thehub.com.au Subject: Small problem with CDPATH processing in 3.1.0 Date: Fri, 17 Jan 1997 17:47:20 +1000 From: Stephen McKay Resent-Message-ID: <"G_z373.0.6z5.Imoto"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/2805 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu I noticed a problem with CDPATH in zsh 3.0.1, and have verified that it is still a problem in zsh 3.1.0 that I just fetched from ftp.ips.oz.au. If you are in directory "/a" and "/a/b" exists and CDPATH=".:/foo" then "cd b" works and does not print the new path. If "/foo/c" exists then "cd c" works and prints the new path "/foo/c". If CDPATH=":/foo" this should work the same, but it does not. Instead, "cd b" "/a/b" to be printed. Following is a suggested patch to zsh 3.1.0 to fix this. It should apply to earlier versions also. By the way, CDPATH="/foo" also works, but will not be well received by /bin/sh (at least under Solaris). It seems foolish for zsh to differ in this way from /bin/sh and it caused me a little trouble with failing shell scripts before I tracked it down. Please note that I have not joined the list, so if you want me to see any replies, you will have to mail me directly. *** builtin.c.dist Sat Dec 21 11:22:26 1996 --- builtin.c Fri Jan 17 17:31:49 1997 *************** *** 1159,1165 **** if (!nocdpath) for (pp = cdpath; *pp; pp++) { if ((ret = cd_try_chdir(*pp, dest))) { ! if (strcmp(*pp, ".")) { doprintdir++; } return ret; --- 1159,1165 ---- if (!nocdpath) for (pp = cdpath; *pp; pp++) { if ((ret = cd_try_chdir(*pp, dest))) { ! if (**pp && strcmp(*pp, ".")) { doprintdir++; } return ret; Cheers, Stephen.