From ffd0b671b845216fe40f2cd41ee9622801d68321 Mon Sep 17 00:00:00 2001 From: Phil Date: Fri, 23 Feb 2018 12:48:38 -0800 Subject: [PATCH] Fix regression caused by Rubocop cleanup InputStream: ``` if @current_entry && @current_entry.gp_flags & 8 == 8 && @current_entry.crc == 0 \ && @current_entry.compressed_size == 0 \ && @current_entry.empty? && !@internal ``` `Zip::Entry#empty?` doesn't exist, but an automatic Rubocop check thought it should be converted from `size == 0`. Unfortunately, this is tricky to write a test for as it only fails under some very specific conditions. --- lib/zip/input_stream.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/zip/input_stream.rb b/lib/zip/input_stream.rb index 4c861c56..5a82f145 100644 --- a/lib/zip/input_stream.rb +++ b/lib/zip/input_stream.rb @@ -129,7 +129,7 @@ def open_entry end if @current_entry && @current_entry.gp_flags & 8 == 8 && @current_entry.crc == 0 \ && @current_entry.compressed_size == 0 \ - && @current_entry.empty? && !@internal + && @current_entry.size == 0 && !@internal raise GPFBit3Error, 'General purpose flag Bit 3 is set so not possible to get proper info from local header.' \ 'Please use ::Zip::File instead of ::Zip::InputStream'