From 0591780a74f9893038d5d794a958621189953e8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Tue, 2 Aug 2022 11:25:51 +0200 Subject: [PATCH] [rubygems/rubygems] Extract entry.full_name to a variable https://github.com/rubygems/rubygems/commit/3973773005 --- lib/rubygems/package.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/rubygems/package.rb b/lib/rubygems/package.rb index 1e87837b0e..8d7aa01f6e 100644 --- a/lib/rubygems/package.rb +++ b/lib/rubygems/package.rb @@ -411,15 +411,16 @@ EOM directories = [] open_tar_gz io do |tar| tar.each do |entry| - next unless File.fnmatch pattern, entry.full_name, File::FNM_DOTMATCH + full_name = entry.full_name + next unless File.fnmatch pattern, full_name, File::FNM_DOTMATCH - destination = install_location entry.full_name, destination_dir + destination = install_location full_name, destination_dir if entry.symlink? link_target = entry.header.linkname real_destination = link_target.start_with?("/") ? link_target : File.expand_path(link_target, File.dirname(destination)) - raise Gem::Package::SymlinkError.new(entry.full_name, real_destination, destination_dir) unless + raise Gem::Package::SymlinkError.new(full_name, real_destination, destination_dir) unless normalize_path(real_destination).start_with? normalize_path(destination_dir + "/") end