Skip to content

Fix frozen error caused by frozen string literal #431

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ rvm:
- 2.4
- 2.5
- 2.6
- 2.7
- ruby-head
matrix:
fast_finish: true
Expand Down
4 changes: 2 additions & 2 deletions lib/zip/crypto/decrypted_io.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def initialize(io, decrypter)
@decrypter = decrypter
end

def read(length = nil, outbuf = '')
def read(length = nil, outbuf = +'')
return ((length.nil? || length.zero?) ? "" : nil) if eof

while length.nil? || (buffer.bytesize < length)
Expand All @@ -25,7 +25,7 @@ def eof
end

def buffer
@buffer ||= ''.dup
@buffer ||= +''
end

def input_finished?
Expand Down
2 changes: 1 addition & 1 deletion lib/zip/entry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ def create_file(dest_path, _continue_on_exists_proc = proc { Zip.continue_on_exi
get_input_stream do |is|
bytes_written = 0
warned = false
buf = ''.dup
buf = +''
while (buf = is.sysread(::Zip::Decompressor::CHUNK_SIZE, buf))
os << buf
bytes_written += buf.bytesize
Expand Down
2 changes: 1 addition & 1 deletion lib/zip/extra_field.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def extra_field_type_unknown(binstr, len, i)
end

def create_unknown_item
s = ''.dup
s = +''
class << s
alias_method :to_c_dir_bin, :to_s
alias_method :to_local_bin, :to_s
Expand Down
2 changes: 1 addition & 1 deletion lib/zip/inflater.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class Inflater < Decompressor #:nodoc:all
def initialize(*args)
super

@buffer = ''.dup
@buffer = +''
@zlib_inflater = ::Zlib::Inflate.new(-Zlib::MAX_WBITS)
end

Expand Down