Update Library/Homebrew/extend/pathname.rb

Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
Douglas Eichelberger 2023-03-22 10:04:53 -07:00 committed by GitHub
parent 91afda651a
commit 9ba677f6d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -472,8 +472,8 @@ class Pathname
@magic_number ||= if directory?
""
else
max_magic_number_length = 262
# Length of the longest regex (currently Tar).
max_magic_number_length = 262
# FIXME: The `T.let` is a workaround until we have https://github.com/sorbet/sorbet/pull/6865
T.let(binread(max_magic_number_length), T.nilable(String)) || ""
end