This is a patch to honour GLOB_CASEMATCH for globbing sets, thus ignoring case
in sets by default.
T:\>cat test.c #include <stdio.h> int _CRT_glob = __CRT_GLOB_USE_MINGW__ | __CRT_GLOB_BRACKET_GROUPS__; int main(int argc, char** argv) { puts(argv[1]); } T:\>gcc test.c -s -o old.exe T:\>gcc test.c -s -o new.exe -Lmingwrt-3.22.4-1 T:\>old [T]* [T]* T:\>new [T]* test.c
Thanks for the patch. I'm not sure that we really want to do this ... after all, it is trivially easy to write a globbing character group to match either case of any included character. I am, however, amenable to persuasion, so please convince me.
I'm amazed that it's not enough that every single Windows program ignores file name case by default. There's also the discrepancy between
r*
(matchingREADME
) and[r]*
(not matchingREADME
), which is not what a Windows user expects - I certainly didn't, hence the patch. And[SsEeTt]
is ugly as sin.Not every program, I'm afraid. More amazing is that, while the the Windows file system is fundamentally case-insensitive, it is also case-retentive, and that latter property has led some MinGW developers to subscribe to the myth, (originally promulgated by the cygwin project, I believe), that it is practicable to pretend case-sensitivity, and even to depend on such pretence. Personally, I don't subscribe to that myth, (and am therefore inclined to accept your patch), but we may need to appease those who do subscribe.
True, but then neither do they expect
[set]
style globbing patterns to be supported, in the first instance.Anyway, since you have provided sufficient justification to satisfy me, (and asking you to convince me was, rather, a form of devil's advocacy ... sorry), if no one else raises a soundly defended objection within the next 14 days, I will go ahead and apply this.
Last edit: Keith Marshall 2017-01-09
I committed [cc2f1a], thanks.
Related
Commit: [cc2f1a]