-
-
Notifications
You must be signed in to change notification settings - Fork 86
"Shell patterns" broken beyond repair #2309
Copy link
Copy link
Open
Labels
area: searchSearch subsystemSearch subsystemprio: mediumHas the potential to affect progressHas the potential to affect progressver: 4.8.33Reproducible in version 4.8.33Reproducible in version 4.8.33
Milestone
Metadata
Metadata
Assignees
Labels
area: searchSearch subsystemSearch subsystemprio: mediumHas the potential to affect progressHas the potential to affect progressver: 4.8.33Reproducible in version 4.8.33Reproducible in version 4.8.33
Type
Fields
Give feedbackNo fields configured for Bug.
Important
This issue was migrated from Trac:
wjaguar(@wjaguar)Function mc_search__glob_translate_to_regex() in lib/search/glob.c is horribly broken, and mishandles a number of trivial patterns such as:
- an inverted character class: "[^abc]" or "[!abc]"
- a freestanding comma: "abc,def"
- a literal brace: "{" or "}"
- an incorrectly formed brace expansion: "{abc}"
- a sequence expression: "{5..10}" or "{a..f}"
Also, a nested brace expansion: "a{b,c{d,e}}f" will produce capturing parentheses for every pair of braces, instead of only the outermost pair.
All this because current code is far too simple-minded to correctly convert Bash patterns into PCRE regexes, and needs a complete rewrite.
Note
Original attachments:
borisonDec 20, 2014 at 22:41 UTCwjaguar(@wjaguar) onFeb 26, 2025 at 22:39 UTCwjaguar(@wjaguar) onFeb 26, 2025 at 22:40 UTCwjaguar(@wjaguar) onFeb 26, 2025 at 22:41 UTC