From 408a83048366a22bf7645b71bee7428743793736 Mon Sep 17 00:00:00 2001 From: Bart Schaefer Date: Sat, 10 Apr 2021 14:26:46 -0700 Subject: 47913: implement CASE_PATHS option to make NO_CASE_GLOB more sensible --- Src/pattern.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'Src/pattern.c') diff --git a/Src/pattern.c b/Src/pattern.c index c28f2c9fb..c0e31b78e 100644 --- a/Src/pattern.c +++ b/Src/pattern.c @@ -509,7 +509,7 @@ void patcompstart(void) { patcompcharsset(); - if (isset(CASEGLOB)) + if (isset(CASEGLOB) || isset(CASEPATHS)) patglobflags = 0; else patglobflags = GF_IGNCASE; @@ -632,6 +632,13 @@ patcompile(char *exp, int inflags, char **endexp) p->patmlen = len; p->patnpar = patnpar-1; +#ifndef __CYGWIN__ /* The filesystem itself is case-insensitive on Cygwin */ + if ((patflags & PAT_FILE) && !isset(CASEGLOB) && !(patflags & PAT_PURES)) { + p->globflags |= GF_IGNCASE; + p->globend |= GF_IGNCASE; + } +#endif + if (!strp) { pscan = (Upat)(patout + startoff); -- cgit v1.2.3