Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always use full logic for processing glob segments. #5378

Merged
merged 2 commits into from Oct 25, 2018

Conversation

Projects
None yet
1 participant
@headius
Copy link
Member

commented Oct 19, 2018

This is a workaround for issues found in #5333. I discovered while
researching a fix for that bug that our glob_helper appears to
be missing "else" logic for the segment processing that handles
magic characters and unescaping. Put simply, if there's no magic
in the segment it leaves it entirely unprocessed, allowing its
contents to just get rolled into the next segment loop (which may
or may not also have magic). However this leaves escapes in place.

This "fix" basically just omits the magic check for each segment
and allows full processing.

Always use full logic for processing glob segments.
This is a workaround for issues found in #5333. I discovered while
researching a fix for that bug that our `glob_helper` appears to
be missing "else" logic for the segment processing that handles
magic characters and unescaping. Put simply, if there's no magic
in the segment it leaves it entirely unprocessed, allowing its
contents to just get rolled into the next segment loop (which may
or may not also have magic). However this leaves escapes in place.

This "fix" basically just omits the magic check for each segment
and allows full processing.

@headius headius added this to the JRuby 9.2.1.0 milestone Oct 19, 2018

@headius

This comment has been minimized.

Copy link
Member Author

commented Oct 25, 2018

This did not pass but it seems like the only failures are for jarred Ruby scripts/gems. I'll see if I can suss out why those are now failing.

@headius

This comment has been minimized.

Copy link
Member Author

commented Oct 25, 2018

It looks like limiting my change to only segments that contain \ chars will work ok.

Narrow change to fix for glob logic for #5333 to only escaped segs
This narrows my fix to only fire for segments with magic chars
(* and ? and the like) or backslashes in the presence of escaped
mode (i.e. not FNM_NOESCAPE). This will slow down the processing
of segments that contain only backslash escapes, but they were not
processed properly before anyway. Segments without backslashes or
magic characters are unaffected. Segments with backslashes and
magic characters are unaffected.

@headius headius merged commit 167d130 into jruby:master Oct 25, 2018

1 check was pending

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details

@headius headius deleted the headius:fix_dir_glob_escaping branch Oct 25, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.