diff --git a/lib/reline/terminfo.rb b/lib/reline/terminfo.rb index d78f3d7b17..3f32a5aab0 100644 --- a/lib/reline/terminfo.rb +++ b/lib/reline/terminfo.rb @@ -71,7 +71,7 @@ module Reline::Terminfo def self.setupterm(term, fildes) errret_int = String.new("\x00" * 8, encoding: 'ASCII-8BIT') ret = @setupterm.(term, fildes, errret_int) - errret = errret_int.unpack('i')[0] + errret = errret_int.unpack1('i') case ret when 0 # OK 0 diff --git a/lib/reline/windows.rb b/lib/reline/windows.rb index 642f33aedf..5bbf1e9d57 100644 --- a/lib/reline/windows.rb +++ b/lib/reline/windows.rb @@ -184,7 +184,7 @@ class Reline::Windows # DWORD FileNameLength; # WCHAR FileName[1]; # } FILE_NAME_INFO - len = p_buffer[0, 4].unpack("L")[0] + len = p_buffer[0, 4].unpack1("L") name = p_buffer[4, len].encode(Encoding::UTF_8, Encoding::UTF_16LE, invalid: :replace) # Check if this could be a MSYS2 pty pipe ('\msys-XXXX-ptyN-XX')