Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: NO_CASE_GLOB and unreadable directories (Episode VI: A New Hope)



On Wed, Jan 13, 2021 at 9:57 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> This is not yet suitable for folding into the master branch, because
> it is a significant change to the current zsh behavior

Found another problem with it:  CASEGLOB was being applied to patterns
in other contexts.

Fixed patch below (gmail is almost certainly going to line-wrap this
one, but since so far it's for discussion only, I'm not terribly
concerned):

diff --git a/Src/pattern.c b/Src/pattern.c
index c7c2c8bea..3d282b533 100644
--- a/Src/pattern.c
+++ b/Src/pattern.c
@@ -509,10 +509,7 @@ void
 patcompstart(void)
 {
     patcompcharsset();
-    if (isset(CASEGLOB))
-       patglobflags = 0;
-    else
-       patglobflags = GF_IGNCASE;
+    patglobflags = 0;
     if (isset(MULTIBYTE))
        patglobflags |= GF_MULTIBYTE;
 }
@@ -632,6 +629,12 @@ patcompile(char *exp, int inflags, char **endexp)
     p->patmlen = len;
     p->patnpar = patnpar-1;

+    if ((patflags & PAT_FILE) && !isset(CASEGLOB) && !(patflags & PAT_PURES)) {
+       /* Special __CYGWIN__ handling needed? */
+       p->globflags |= GF_IGNCASE;
+       p->globend |= GF_IGNCASE;
+    }
+
     if (!strp) {
        pscan = (Upat)(patout + startoff);




Messages sorted by: Reverse Date, Date, Thread, Author