Skip to content

Fix Glob#to_regexp crash on brace patterns - #252

Open
SAY-5 wants to merge 1 commit into
cqfn:masterfrom
SAY-5:fix-glob-braces-curlies
Open

SAY-5 wants to merge 1 commit into
cqfn:masterfrom
SAY-5:fix-glob-braces-curlies

Conversation

@SAY-5

@SAY-5 SAY-5 commented Jul 20, 2026

Copy link
Copy Markdown

Fixes #248.

curlies = 0, escaping = false on line 16 of utils/glob.rb was parsed as curlies = [0, false], so curlies ended up an Array and any pattern with a brace crashed at curlies += 1 / curlies.positive?. Split it into two assignments. The return statements inside the chars.map block also returned from the whole method instead of the block, so I changed them to next. Added test/test_glob.rb covering brace expansion, an unmatched }, and an escaped char.

Signed-off-by: Sai Asish Y <say.apm35@gmail.com>
@SAY-5
SAY-5 force-pushed the fix-glob-braces-curlies branch from 64af1ca to c4ffbd6 Compare July 20, 2026 07:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

utils/glob.rb:16: curlies = 0, escaping = false makes curlies an Array, crashing every glob with braces

1 participant