From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22257 invoked by alias); 24 Feb 2014 15:38:34 -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: 32432 Received: (qmail 12105 invoked from network); 24 Feb 2014 15:38:27 -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=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 From: Bart Schaefer Message-id: <140224073824.ZM846@torch.brasslantern.com> Date: Mon, 24 Feb 2014 07:38:24 -0800 In-reply-to: <2708.1393252680@thecus.kiddle.eu> Comments: In reply to Oliver Kiddle "Re: segfault with exceedingly long path" (Feb 24, 3:38pm) References: <20140118002033.GY27889@sym.noone.org> <140117174902.ZM7366@torch.brasslantern.com> <20140119191048.018a051a@pws-pc.ntlworld.com> <140119133550.ZM5354@torch.brasslantern.com> <20140119221310.GA502@ruderich.org> <140119160238.ZM5850@torch.brasslantern.com> <140119171049.ZM18371@torch.brasslantern.com> <2708.1393252680@thecus.kiddle.eu> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: segfault with exceedingly long path MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Feb 24, 3:38pm, Oliver Kiddle wrote: } } So if the directory starts as / the !*xbuf test succeeds and it prints } the warning. I'm not sure whether it would be better to skip the whole } xsymlinks call for a path of "/" or to check the return status from it. Hrm. xsymlinks() is meant to return 1 when there was a symbolic link followed, but it is also responsible for collapsing out "../" so in xsymlink() the return value doesn't tell us whether the input and output paths should be the same. Also: torch% cd /tmp/../ zsh: path expansion failed, using root directory torch% ln -s / /tmp/root torch% cd /tmp/root zsh: path expansion failed, using root directory So neither checking the return value nor skipping xsymlinks() for "/" will work, we actually have to differentiate paths that resolve to the root from paths that fail to resolve. This is going to require more analysis of xsymlinks() than I have time to do today (possibly more than I have time to do this week).