From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18185 invoked by alias); 7 Aug 2013 08:49:48 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 31635 Received: (qmail 3664 invoked from network); 7 Aug 2013 08:49:44 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at spodhuis.org does not designate permitted sender hosts) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=spodhuis.org; s=d201210; h=Content-Type:MIME-Version:Message-ID:Subject:To:From:Date; bh=DsxhHijMx+UYRA3GDHgkHcQ/YjCslA1pU6kV+DArwnk=; b=leQ2gd8BJf3v02Ha2JZzVayoDfvygrZoNn0EyV9FdpG71faTdrpJN9NJhtgCQRbC0wxtxqYVDOHl9rZpWC3B4u/+c/jc7Ac8ssokP7kZU3XO+T2NfTtpLac9AYWpVbtFRzjuPxmfKEAhmle10sIEMj4gpc/fUDncqYtPWSJEMlo=; Date: Wed, 7 Aug 2013 04:49:38 -0400 From: Phil Pennock To: zsh-workers@zsh.org Subject: cdpath and empty string Message-ID: <20130807084938.GA94638@redoubt.spodhuis.org> Mail-Followup-To: zsh-workers@zsh.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Finally got irritated enough to track down what's required to trigger what looks like a zsh bug. % mkdir /tmp/T1 /tmp/T2 /tmp/T2/T1 % zsh -f redoubt% typeset -a cdpath redoubt% cdpath=(/tmp/T1 '') redoubt% cd /tmp/T2 redoubt% cd T1 /tmp/T1/T1 redoubt% pwd /tmp/T2/T1 redoubt% echo $PWD /tmp/T1/T1 redoubt% cd . redoubt% echo $PWD /tmp/T2/T1 If $cdpath has an empty string at the end (in my case, using "${cdpath[@]}" instead of ${cdpath[@]} when prepending elements), then "cd foo" for unqualified 'foo' which is only found relative to cwd will always print $cdpath[1]/foo while cd'ing into ./foo. $PWD is left corrupted, fixed by "cd ."; pwd is fine. I haven't figured out where this is happening; I know it's in the C, but reading the code I can't tell where and I need to get back to work instead of continuing to investigate. :( Any thoughts? -Phil