From 55fbb67cfbc42a479311f5d50ab729b11ac1af43 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 31 Dec 2009 10:18:43 +0100 Subject: archive/zzip: set input_stream.{size,offset} --- src/archive/zzip_archive_plugin.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/archive') diff --git a/src/archive/zzip_archive_plugin.c b/src/archive/zzip_archive_plugin.c index 43c880aab..6c477c0af 100644 --- a/src/archive/zzip_archive_plugin.c +++ b/src/archive/zzip_archive_plugin.c @@ -36,7 +36,6 @@ struct zzip_archive { ZZIP_DIR *dir; ZZIP_FILE *file; - size_t length; GSList *list; GSList *iter; }; @@ -139,7 +138,7 @@ zzip_archive_open_stream(struct archive_file *file, struct input_stream *is, return false; } zzip_file_stat(context->file, &z_stat); - context->length = z_stat.st_size; + is->size = z_stat.st_size; return true; } @@ -164,6 +163,9 @@ zzip_input_read(struct input_stream *is, void *ptr, size_t size, "zzip_file_read() has failed"); return 0; } + + is->offset = zzip_tell(context->file); + return ret; } @@ -171,7 +173,7 @@ static bool zzip_input_eof(struct input_stream *is) { struct zzip_archive *context = (struct zzip_archive *) is->data; - return ((size_t) zzip_tell(context->file) == context->length); + return (goffset)zzip_tell(context->file) == is->size; } static bool -- cgit v1.2.3