From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21514 invoked from network); 25 Apr 2006 12:55:57 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.1 (2006-03-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.1 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 25 Apr 2006 12:55:57 -0000 Received: (qmail 62279 invoked from network); 25 Apr 2006 12:55:52 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 25 Apr 2006 12:55:52 -0000 Received: (qmail 23694 invoked by alias); 25 Apr 2006 12:55:48 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 22429 Received: (qmail 23684 invoked from network); 25 Apr 2006 12:55:47 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 25 Apr 2006 12:55:47 -0000 Received: (qmail 61849 invoked from network); 25 Apr 2006 12:55:47 -0000 Received: from cluster-d.mailcontrol.com (217.69.20.190) by a.mx.sunsite.dk with SMTP; 25 Apr 2006 12:55:46 -0000 Received: from exchange03.csr.com (uuk202166.uk.customer.alter.net [62.189.241.194] (may be forged)) by rly37d.srv.mailcontrol.com (MailControl) with ESMTP id k3PCtjDT001503 for ; Tue, 25 Apr 2006 13:55:45 +0100 Received: from csr.com ([10.103.143.38]) by exchange03.csr.com with Microsoft SMTPSVC(5.0.2195.6713); Tue, 25 Apr 2006 13:55:44 +0100 To: zsh-workers@sunsite.dk (Zsh hackers list) Subject: PATCH: globbing fix Date: Tue, 25 Apr 2006 13:55:45 +0100 From: Peter Stephenson Message-ID: X-OriginalArrivalTime: 25 Apr 2006 12:55:44.0930 (UTC) FILETIME=[90F17020:01C66867] Content-Type: text/plain MIME-Version: 1.0 X-Scanned-By: MailControl A-06-00-05 (www.mailcontrol.com) on 10.68.0.147 There's a subtle bug in the code to support multibyte patterns. If a path includes a segment which is specially handled, so that it doesn't exist in the directory but springs into existence when referenced, you can't use it in a pattern. I found this when looking at the ".snaphost" directory of a Netapp file server, which contains backups of recent versions of files. Index: Src/pattern.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/pattern.c,v retrieving revision 1.31 diff -u -r1.31 pattern.c --- Src/pattern.c 9 Apr 2006 21:55:10 -0000 1.31 +++ Src/pattern.c 25 Apr 2006 12:52:22 -0000 @@ -1137,7 +1137,7 @@ * ..(#a1).. (i.e. the (#a1) has no effect), but if you're * going to write funny patterns, you get no sympathy from me. */ - if (patglobflags) { + if (patglobflags & (0xFF|GF_LCMATCHUC|GF_IGNCASE)) { if (!(patflags & PAT_FILE)) flags &= ~P_PURESTR; else if (!(nptr[0] == '.' && -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070 To access the latest news from CSR copy this link into a web browser: http://www.csr.com/email_sig.php