Skip to content

Update fnmatch implementation#6231

Merged
headius merged 4 commits intojruby:masterfrom
headius:update_fnmatch
May 19, 2020
Merged

Update fnmatch implementation#6231
headius merged 4 commits intojruby:masterfrom
headius:update_fnmatch

Conversation

@headius
Copy link
Member

@headius headius commented May 19, 2020

This PR will have a few commits to re-port the fnmatch logic from CRuby. Will fix #6193 and others.

This updates our fnmatch port to more closely resemble the code
in CRuby. Specifically this work is intended to fix jruby#6193 but the
additional cleanup may fix other issues. Remaining work mostly
involves properly advancing the character pointers in the
presence of a multibyte encoding.
headius added 2 commits May 19, 2020 05:13
This fixes the remaining failurue in CRuby's test_fnmatch.

A bit of refactoring came along for the ride.

Part of work for jruby#6193
@headius headius marked this pull request as ready for review May 19, 2020 10:15
CRuby will blow by this code because even s == send will just
yield a null byte. We preemptively guard against p or s being
at their respective ends already.
@headius headius merged commit 54ad5d1 into jruby:master May 19, 2020
@headius headius deleted the update_fnmatch branch May 19, 2020 10:54
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.

File.fnmatch with File::FNM_PATHNAME doesn't treat [/a] or [a/] like [a] as MRI does

1 participant