Skip to content

Commit

Permalink
Fixing Zip#read_local_entry error on JRuby
Browse files Browse the repository at this point in the history
  • Loading branch information
kinkou committed Mar 7, 2015
1 parent 61a4435 commit b7fa9b1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ Gemfile.lock
+samples/*.zip.*
coverage
pkg/
.ruby-gemset
.ruby-version
2 changes: 1 addition & 1 deletion lib/zip/entry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def unpack_local_entry(buf)
def read_local_entry(io) #:nodoc:all
@local_header_offset = io.tell

static_sized_fields_buf = io.read(::Zip::LOCAL_ENTRY_STATIC_HEADER_LENGTH)
static_sized_fields_buf = io.read(::Zip::LOCAL_ENTRY_STATIC_HEADER_LENGTH) || ''

unless static_sized_fields_buf.bytesize == ::Zip::LOCAL_ENTRY_STATIC_HEADER_LENGTH
raise Error, "Premature end of file. Not enough data for zip entry local header"
Expand Down

0 comments on commit b7fa9b1

Please sign in to comment.