* PATCH: 3.1.5: fix for case-insensitivity patch
@ 1998-12-01 14:46 Peter Stephenson
0 siblings, 0 replies; only message in thread
From: Peter Stephenson @ 1998-12-01 14:46 UTC (permalink / raw)
To: Zsh hackers list
% [[ 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 <pws@ibmth.df.unipi.it> Tel: +39 050 844536
WWW: http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1998-12-01 15:09 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-12-01 14:46 PATCH: 3.1.5: fix for case-insensitivity patch Peter Stephenson
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).