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 @@ -14,6 +14,7 @@ Bug fixes:
14
14
* Fix ` Integer#{<<,>>} ` with RHS bignum and long (@eregon ).
15
15
* Fix a resource leak from allocators defined in C extensions (@aardvark179 ).
16
16
* ` SIGINT ` /` Interrupt ` /` Ctrl+C ` now shows the backtrace and exits as signaled, like CRuby (@eregon ).
17
+ * Update patch feature finding to prefer the longest matching load path (#2605 , @bjfish ).
17
18
18
19
Compatibility:
19
20
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