summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
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