Skip to content

Commit

Permalink
Fix regression caused by Rubocop cleanup
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
pnomolos committed Feb 23, 2018
1 parent 2f80da6 commit ffd0b67
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/zip/input_stream.rb
Expand Up @@ -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'
Expand Down

0 comments on commit ffd0b67

Please sign in to comment.