From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18614 invoked from network); 1 Dec 1998 15:09:58 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 1 Dec 1998 15:09:58 -0000 Received: (from list@localhost) by math.gatech.edu (8.9.1/8.9.1) id KAA13141; Tue, 1 Dec 1998 10:02:44 -0500 (EST) Resent-Date: Tue, 1 Dec 1998 10:02:44 -0500 (EST) Message-Id: <9812011446.AA29219@ibmth.df.unipi.it> To: zsh-workers@math.gatech.edu (Zsh hackers list) Subject: PATCH: 3.1.5: fix for case-insensitivity patch Date: Tue, 01 Dec 1998 15:46:16 +0100 From: Peter Stephenson Resent-Message-ID: <"94-O33.0.GD3.KK0Ps"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/4693 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu % [[ Modules = (#i)*m* ]] || print Stephenson\'s wrecked the shell again Stephenson's wrecked the shell again *** Misc/globtests.ci3 Tue Nov 3 11:35:36 1998 --- Misc/globtests Tue Dec 1 15:39:36 1998 *************** *** 112,116 **** --- 112,117 ---- f fooxx ((#i)FOOX)X f BAR (bar|(#i)foo) t FOO (bar|(#i)foo) + t Modules (#i)*m* EOT print "$failed tests failed." *** Misc/globtests.ksh.ci3 Tue Nov 3 11:35:54 1998 --- Misc/globtests.ksh Tue Dec 1 15:39:32 1998 *************** *** 96,100 **** --- 96,101 ---- f fooxx @((#i)FOOX)X f BAR @(bar|(#i)foo) t FOO @(bar|(#i)foo) + t Modules (#i)*m* EOT print "$failed tests failed." *** Src/glob.c.ci3 Sat Nov 14 16:31:54 1998 --- Src/glob.c Tue Dec 1 15:41:23 1998 *************** *** 2182,2187 **** --- 2182,2196 ---- } } + /* + * Match characters with case-insensitivity. + * Note CHARMATCH(x,y) != CHARMATCH(y,x) + */ + #define CHARMATCH(x, y) \ + (x == y || (((c->stat & C_IGNCASE) ? (tulower(x) == tulower(y)) : \ + (c->stat & C_LCMATCHUC) ? (islower(y) && tuupper(y) == x) : 0))) + + /* see if current string in pptr matches c */ /**/ *************** *** 2219,2225 **** for (; *pptr; pptr++) { if (*pptr == Meta) pptr++; ! else if (*pptr == looka) break; } if (!*(saves = pptr)) --- 2228,2234 ---- for (; *pptr; pptr++) { if (*pptr == Meta) pptr++; ! else if (CHARMATCH(*pptr, looka)) break; } if (!*(saves = pptr)) *************** *** 2589,2598 **** } continue; } ! if (*pptr == *pat || ! (((c->stat & C_IGNCASE) ? (tulower(*pat) == tulower(*pptr)) : ! (c->stat & C_LCMATCHUC) ? ! (islower(*pat) && tuupper(*pat) == *pptr) : 0))) { /* just plain old characters */ pptr++; pat++; --- 2598,2604 ---- } continue; } ! if (CHARMATCH(*pptr, *pat)) { /* just plain old characters */ pptr++; pat++; -- Peter Stephenson Tel: +39 050 844536 WWW: http://www.ifh.de/~pws/ Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy