summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDmytro Shyrshov <shirshov.dmitriy@gmail.com>2020-02-20 22:07:40 +0200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2020-05-08 14:13:29 +0900
commit03fe7da186ff239a3cebaca3f2ce1e1c4b7d243f (patch)
tree61963d6f3cbce203b850c1fcb90d55eb569130b1 /lib
parent7574b836a96fe4716ee40c920aa21ceb9530e733 (diff)
[rubygems/rubygems] Allow spaces in file headers during octal check
https://github.com/rubygems/rubygems/commit/e9e25731d8
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3092
Diffstat (limited to 'lib')
-rw-r--r--lib/rubygems/package/tar_header.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/rubygems/package/tar_header.rb b/lib/rubygems/package/tar_header.rb
index c37612772a..83a208bdf3 100644
--- a/lib/rubygems/package/tar_header.rb
+++ b/lib/rubygems/package/tar_header.rb
@@ -126,7 +126,8 @@ class Gem::Package::TarHeader
end
def self.strict_oct(str)
- return str.oct if str =~ /\A[0-7]*\z/
+ return str.strip.oct if str.strip =~ /\A[0-7]*\z/
+
raise ArgumentError, "#{str.inspect} is not an octal string"
end