Menu

#2327 Honour GLOB_CASEMATCH for globbing sets

WSL
closed
None
Feature
fixed
IINR_-_Include_In_Next_Release
True
2017-01-26
2017-01-05
Jason Hood
No

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
1 Attachments

Discussion

  • Keith Marshall

    Keith Marshall - 2017-01-08

    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.

     
  • Jason Hood

    Jason Hood - 2017-01-09

    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* (matching README) and [r]* (not matching README), which is not what a Windows user expects - I certainly didn't, hence the patch. And [SsEeTt] is ugly as sin.

     
    • Keith Marshall

      Keith Marshall - 2017-01-09

      I'm amazed that it's not enough that every single Windows program ignores file name case by default.

      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.

      There's also the discrepancy between r* (matching README) and [r]* (not matching README), which is not what a Windows user expects ...

      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
  • Keith Marshall

    Keith Marshall - 2017-01-26
    • status: unread --> closed
    • assigned_to: Keith Marshall
    • Type: Bug --> Feature
    • Resolution: none --> fixed
    • Category: Unknown --> IINR_-_Include_In_Next_Release
     
  • Keith Marshall

    Keith Marshall - 2017-01-26

    I committed [cc2f1a], thanks.

     

    Related

    Commit: [cc2f1a]