Skip to content

Additional fixes for scheme-based globbing#8978

Merged
headius merged 1 commit intojruby:masterfrom
headius:glob_nonmagic_alpha
Aug 27, 2025
Merged

Additional fixes for scheme-based globbing#8978
headius merged 1 commit intojruby:masterfrom
headius:glob_nonmagic_alpha

Conversation

@headius
Copy link
Member

@headius headius commented Aug 26, 2025

This fixes one issue with the new logic to process globs without scheme. The intent of this code appears to have been to remove the scheme from the path portion, used for fnmatching and character-by- character comparisons. However in that case the scheme must always be prepended when querying the "filesystem", so that URLs and such can always use appropriate logic. The patch here does the following:

  • Fully remove the scheme from the passed-in path, since the glob_helper logic seems to assume that the path bytes provided will be the schemeless full path.
  • Prepend the scheme when checking each link in the path, so that appropriate exotic filesystem checks work correctly.

This appears to fix the issue in #8973.

@headius headius added this to the JRuby 10.0.3.0 milestone Aug 26, 2025
This fixes one issue with the new logic to process globs without
scheme. The intent of this code appears to have been to remove the
scheme from the path portion, used for fnmatching and character-by-
character comparisons. However in that case the scheme must always
be prepended when querying the "filesystem", so that URLs and such
can always use appropriate logic. The patch here does the
following:

* Fully remove the scheme from the passed-in path, since the
  glob_helper logic seems to assume that the path bytes provided
  will be the schemeless full path.
* Prepend the scheme when checking each link in the path, so that
  appropriate exotic filesystem checks work correctly.

This appears to fix the issue in jruby#8973.
@headius headius force-pushed the glob_nonmagic_alpha branch from 366c8e9 to 8e50d1c Compare August 26, 2025 20:56
@headius headius merged commit fef2470 into jruby:master Aug 27, 2025
73 checks passed
@headius headius deleted the glob_nonmagic_alpha branch August 27, 2025 01:52
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.

1 participant