aboutsummaryrefslogtreecommitdiffstats
path: root/src/archive
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-12-31 10:18:43 +0100
committerMax Kellermann <max@duempel.org>2009-12-31 15:59:43 +0100
commit55fbb67cfbc42a479311f5d50ab729b11ac1af43 (patch)
tree160dd57a0c1f129f9fac2f577e8dd25901ad4c92 /src/archive
parenta0384aaead1427e9f7bd3643c4149371d687e53d (diff)
downloadmpd-55fbb67cfbc42a479311f5d50ab729b11ac1af43.tar.gz
mpd-55fbb67cfbc42a479311f5d50ab729b11ac1af43.tar.xz
mpd-55fbb67cfbc42a479311f5d50ab729b11ac1af43.zip
archive/zzip: set input_stream.{size,offset}
Diffstat (limited to '')
-rw-r--r--src/archive/zzip_archive_plugin.c8
1 files changed, 5 insertions, 3 deletions
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