#ifdef __CYGWIN__
#define Cchar(c) (ignore_case_with_glob ? towlower (c) : (c))
-#else
-#define Cchar(c) (c)
#endif
#undef MAXPATHLEN
#define SLASH '/'
#define COMMA ','
-#undef DEBUG /* never define */
#ifndef DEBUG
#define M_QUOTE 0x40000000U
return (GLOB_NOMATCH);
else if (clen == 0)
break;
- *bufnext++ = Cchar(wc);
+ *bufnext++ = wc;
patnext += clen;
}
} else {
return (GLOB_NOMATCH);
else if (clen == 0)
break;
- *bufnext++ = Cchar(wc) | prot;
+ *bufnext++ = wc | prot;
patnext += clen;
}
}
break;
sc += clen;
}
-#ifdef __CYGWIN__
- if (ignore_case_with_glob) {
- wint_t lower_path[MAXPATHLEN];
- wint_t *lp = lower_path, *sp = pathend;
-
- while ((*lp++ = towlower(*sp++)))
- ;
- if (!match(lower_path, pattern, restpattern)) {
- *pathend = EOS;
- continue;
- }
- } else
-#endif
if (!match(pathend, pattern, restpattern)) {
*pathend = EOS;
continue;
return(0);
break;
default:
- if (*name++ != *c)
+ if (Cchar(*name++) != Cchar(*c))
return(0);
break;
}
- Don't skip inadvertently some local SAM accounts on domain member
machines.
+
+- Revert ill-advised optimization of glob(3) in case of caseinsensitive
+ globbing.
+ Addresses: https://cygwin.com/pipermail/cygwin/2024-March/255675.html