Skip to content

Commit

Permalink
Update lib/datadog/di/code_tracker.rb
Browse files Browse the repository at this point in the history
Co-authored-by: Sergey Fedorov <oni.strech@gmail.com>
  • Loading branch information
p-datadog and Strech committed Sep 30, 2024
1 parent ff0d80c commit 95c976b
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/datadog/di/code_tracker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,9 @@ def iseqs_for_path(suffix)
# therefore simply permitting forward or back slash is not
# sufficient, we need to perform an OS check to know which
# path separator to use.
if path.length > suffix.length && (
path[path.length - suffix.length - 1] == "/" ||
suffix[0] == "/"
) && path.end_with?(suffix)
inexact << iseq
if path.length > suffix.length && path.end_with?(suffix)
previous_char = path[path.length - suffix.length - 1]
inexact << iseq if (previous_char == "/" || suffix[0] == "/")
end
end
inexact
Expand Down

0 comments on commit 95c976b

Please sign in to comment.