From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26587 invoked from network); 8 Mar 2004 12:03:44 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 8 Mar 2004 12:03:44 -0000 Received: (qmail 1579 invoked by alias); 8 Mar 2004 12:03:37 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 19554 Received: (qmail 1540 invoked from network); 8 Mar 2004 12:03:37 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 8 Mar 2004 12:03:37 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [62.189.58.19] by sunsite.dk (MessageWall 1.0.8) with SMTP; 8 Mar 2004 12:3:37 -0000 Received: from MAILSWEEPER01.csr.com (mailhost1.csr.com [62.189.183.235]) by lhuumrelay3.lnd.ops.eu.uu.net (8.11.0/8.11.0) with ESMTP id i28C3av11523 for ; Mon, 8 Mar 2004 12:03:36 GMT Received: from EXCHANGE02.csr.com (unverified [192.168.137.45]) by MAILSWEEPER01.csr.com (Content Technologies SMTPRS 4.3.12) with ESMTP id for ; Mon, 8 Mar 2004 12:03:16 +0000 Received: from csr.com ([192.168.144.127]) by EXCHANGE02.csr.com with Microsoft SMTPSVC(5.0.2195.6713); Mon, 8 Mar 2004 12:05:27 +0000 To: zsh-workers@sunsite.dk (Zsh hackers list) Subject: Re: PATCH: case-insensitive globbing In-reply-to: "Peter Stephenson"'s message of "Mon, 08 Mar 2004 10:33:49 GMT." <18393.1078742029@csr.com> Date: Mon, 08 Mar 2004 12:03:36 +0000 Message-ID: <10956.1078747416@csr.com> From: Peter Stephenson X-OriginalArrivalTime: 08 Mar 2004 12:05:27.0296 (UTC) FILETIME=[A4E98800:01C40505] Peter Stephenson wrote: > There's one patch I need to get in to improve efficiency on Cygwin > (currently the shell will try to search the entire directory for files > since it doesn't know the OS treats all files case insensitively) > which I'll try and do later. This is it. Seems to work OK, but could do with some playing around with by a Cygwin hacker. Oliver wrote: > It's just a thought but would it be somehow possible to detect the > filesystem type and allow the efficency gain to be of use where, for > example, a windows partition is mounted from linux. Yes, it occurred to me, but it's too complicated for now. Also, it means checking for every single file when the option is on. I'm not sure this can be done efficiently. Index: Src/pattern.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/pattern.c,v retrieving revision 1.17 diff -u -r1.17 pattern.c --- Src/pattern.c 6 Mar 2004 00:23:03 -0000 1.17 +++ Src/pattern.c 8 Mar 2004 11:49:37 -0000 @@ -344,7 +344,16 @@ if (!(patflags & PAT_ANY)) { /* Look for a really pure string, with no tokens at all. */ - if (!patglobflags) + if (!patglobflags +#ifdef __CYGWIN__ + /* + * If the OS treats files case-insensitively and we + * are looking at files, we don't need to use pattern + * matching to find the file. + */ + || (!(patglobflags & ~GF_IGNCASE) && (patflags & PAT_FILE)) +#endif + ) for (strp = exp; *strp && (!(patflags & PAT_FILE) || *strp != '/') && !itok(*strp); strp++) -- Peter Stephenson Software Engineer CSR Ltd., Science Park, Milton Road, Cambridge, CB4 0WH, UK Tel: +44 (0)1223 692070 ********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com **********************************************************************