File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
src/main/ruby/truffleruby/core/truffle Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ Bug fixes:
11
11
* Raise ` RangeError ` for ` Time.at(bignum) ` (#2580 , @eregon ).
12
12
* Fix ` Integer#{<<,>>} ` with RHS bignum and long (@eregon ).
13
13
* Fix a resource leak from allocators defined in C extensions (@aardvark179 ).
14
+ * Update patch feature finding to prefer the longest matching load path (#2605 , @bjfish ).
14
15
15
16
Compatibility:
16
17
Original file line number Diff line number Diff line change @@ -219,10 +219,11 @@ def self.provide_feature(feature)
219
219
end
220
220
221
221
def self . relative_feature ( expanded_path )
222
- load_path_entry = get_expanded_load_path . find do |load_dir |
222
+ load_path_entries = get_expanded_load_path . select do |load_dir |
223
223
expanded_path . start_with? ( load_dir ) and expanded_path [ load_dir . size ] == '/'
224
224
end
225
- if load_path_entry
225
+ if !load_path_entries . empty?
226
+ load_path_entry = load_path_entries . max_by ( &:length )
226
227
before_dot_rb = expanded_path . end_with? ( '.rb' ) ? -4 : -1
227
228
expanded_path [ load_path_entry . size +1 ..before_dot_rb ]
228
229
else
You can’t perform that action at this time.
0 commit comments