Skip to content

Commit

Permalink
Allow for partial writes as suggested by @crog. Fixes #2.
Browse files Browse the repository at this point in the history
  • Loading branch information
CTrabant committed Aug 3, 2015
1 parent 94a53ec commit fbd76fb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
2015.8.2:
2015.8.2: 1.1
- Rework deflate() logic for flexibility and simplicity.
- Add zs_entryflush() as a simple wrapper to flush internal compression
buffers without new data. Thanks to @Crog for reporting and suggesting.
- Update zipfiles.c example code to use new zs_entryflush().
- Allow retry of write() in zs_writedata() for incomplete writes as
suggested by @Crog.
- Add Apache 2 licensing notices.

2013.9.28: 1.0
Expand Down
6 changes: 3 additions & 3 deletions fdzipstream.c
Original file line number Diff line number Diff line change
Expand Up @@ -913,13 +913,13 @@ zs_writedata ( ZIPstream *zstream, unsigned char *writeentry,

lwritestatus = write (zstream->fd, writeentry+written, writelen);

if ( lwritestatus != writelen )
if ( lwritestatus <= 0 )
{
return lwritestatus;
}

zstream->WriteOffset += writelen;
written += writelen;
zstream->WriteOffset += lwritestatus;
written += lwritestatus;
}

return written;
Expand Down

0 comments on commit fbd76fb

Please sign in to comment.