From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6862 invoked by alias); 28 Oct 2016 15:12:43 -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: 39748 Received: (qmail 22463 invoked from network); 28 Oct 2016 15:12:43 -0000 X-Qmail-Scanner-Diagnostics: from out5-smtp.messagingengine.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(66.111.4.29):SA:0(0.0/5.0):. Processed in 0.150979 secs); 28 Oct 2016 15:12:43 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: d.s@daniel.shahaf.name X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at daniel.shahaf.name does not designate permitted sender hosts) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= mesmtp; bh=OOe1El6LF2mCX4VfixH0VThwSPg=; b=MZ/F/W4D9uyhAF4Af1Jk1 JGaOG8r4j2GU0H5UUdTceWFauRTIQtCUE2fTdQAtkB51dMeOpEzwMuk8WQYk+ugp iu31j7yTV4C1aSpIqK1iSjobqfWVH/BL08sCAGtspE8/iiw64AHvNgy+HMlWNyrR 4v1zBApUdRP0wjD483wuNo= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= smtpout; bh=OOe1El6LF2mCX4VfixH0VThwSPg=; b=pQXdp4kBvzpNl9rvWvpV EUpqVKWsXEeZbzMTfy3b2jOUTHPB5rzY8TgbBUOJPsrODO+MvDipLuztxFVs2KW9 wDz5ep/usEy0aN8KvpXhRFjMb8uc7EqYzkXUyL//qwB9/VK9HTPXV4h1WyW6ZvTs mS13GIn/YWF1mcGJA57VQaw= X-ME-Sender: X-Sasl-enc: 2W0D9SMvpM9mq+DlL+IP4J4CyJiZaKVpbHuELT+FPM2K 1477667560 Date: Fri, 28 Oct 2016 15:10:37 +0000 From: Daniel Shahaf To: Mikael Magnusson Cc: zsh workers Subject: Re: Bug: cd auto-completion of .. fails with parentheses in directory name Message-ID: <20161028151037.GA10483@fujitsu.shahaf.local2> References: <20160922144250.GA11076@fujitsu.shahaf.local2> <160922103042.ZM7407@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Mikael Magnusson wrote on Fri, Oct 28, 2016 at 03:56:08 +0200: > On Thu, Sep 22, 2016 at 7:30 PM, Bart Schaefer > wrote: > > On Sep 22, 2:42pm, Daniel Shahaf wrote: > > } > > } 1) Is the lifetime correct? I'm not sure whether elemnts of 'l' should > > } be malloc()ed or heap allocated. > > > > I think you have this correct -- completion is designed to put nearly > > all of its data in a private zsh heap that is discarded all at once > > when control returns to the line editor. Only specific bits that persist > > across calls go into directly-malloc'd memory. > > > > } 2) Should quoting be added in bin_compfiles() or at a later point during > > } cf_pats()? Although the docstring of cfp_test_exact() says the elements > > } of 'l' are filenames, they are then passed to ztat() which ignores > > } backslashes, so it's not clear to me what quoting is expected where. > > > > I think you have this in the right place, too, but I would be glad to > > have someone else confirm. Or we can just put it in and see if any > > other examples break. > > This patch breaks completion of > % mkdir '[a]'; touch '[a]/foo' > % ls \[a\]/ # gives no results > > for me. Reverting it on current master fixes it. The new quotestring() is called in the input «\[a\]», (5 bytes), so it becomes double-escaped. Added to my list.