From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17479 invoked from network); 23 Aug 2008 14:56:42 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 23 Aug 2008 14:56:42 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 3346 invoked from network); 23 Aug 2008 14:56:17 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 23 Aug 2008 14:56:17 -0000 Received: (qmail 10061 invoked by alias); 23 Aug 2008 14:56:05 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 25514 Received: (qmail 10045 invoked from network); 23 Aug 2008 14:56:04 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 23 Aug 2008 14:56:04 -0000 Received: from vms173005pub.verizon.net (vms173005pub.verizon.net [206.46.173.5]) by bifrost.dotsrc.org (Postfix) with ESMTP id 7AF5A801E2B4 for ; Sat, 23 Aug 2008 16:55:58 +0200 (CEST) Received: from torch.brasslantern.com ([96.238.220.178]) by vms173005.mailsrvcs.net (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPA id <0K6200IIQ6T4KUSF@vms173005.mailsrvcs.net> for zsh-workers@sunsite.dk; Sat, 23 Aug 2008 09:55:53 -0500 (CDT) Received: from torch.brasslantern.com (localhost.localdomain [127.0.0.1]) by torch.brasslantern.com (8.13.1/8.13.1) with ESMTP id m7NEtpgY005498 for ; Sat, 23 Aug 2008 07:55:52 -0700 Received: (from schaefer@localhost) by torch.brasslantern.com (8.13.1/8.13.1/Submit) id m7NEtp9L005497 for zsh-workers@sunsite.dk; Sat, 23 Aug 2008 07:55:51 -0700 Date: Sat, 23 Aug 2008 07:55:49 -0700 From: Bart Schaefer Subject: Re: "pws non-canonical hack" problems In-reply-to: <20080823072446.GM8612@altlinux.org> To: zsh-workers@sunsite.dk Message-id: <080823075551.ZM5496@torch.brasslantern.com> MIME-version: 1.0 X-Mailer: OpenZMail Classic (0.9.2 24April2005) Content-type: text/plain; charset=us-ascii References: <20080823072446.GM8612@altlinux.org> Comments: In reply to "Alexey I. Froloff" ""pws non-canonical hack" problems" (Aug 23, 11:24am) X-Virus-Scanned: ClamAV 0.92.1/8077/Sat Aug 23 09:28:12 2008 on bifrost X-Virus-Status: Clean On Aug 23, 11:24am, Alexey I. Froloff wrote: } } _path_files: } 377 # pws non-canonical hack which seems to work so far... } 378 # if we didn't match by globbing, check that there is } 379 # something to match by explicit name. This is for } 380 # `clever' filing systems where names pop into existence } 381 # when referenced. } 382 if (( ! $#tmp1 )); then } 383 for tmp3 in "$tmp2[@]"; do } 384 if [[ -n $tmp3 && $tmp3 != */ ]]; then } 385 tmp3+=/ } 386 fi } 387 if [[ -e "$tmp3${(Q)PREFIX}${(Q)SUFFIX}" ]] then } 388 tmp1+=("$tmp3${(Q)PREFIX}${(Q)SUFFIX}") } 389 fi } 390 done } 391 fi } } When I completing directory, sometimes file is being completed. The problem is that this code should not unconditionally append something to tmp1. It has to test again (probably by using some variant of the call to compfiles that appears 20 or so lines above) that some new file really was created that matches the qualifiers in the generated glob pattern. Really this whole idea of attempting to complete things that don't exist yet puts a huge amount of overhead on the cases where nothing ever will. --