summaryrefslogtreecommitdiff
path: root/plugins/vfs_zip
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <waker@users.sourceforge.net>2014-01-04 13:47:12 +0100
committerGravatar Alexey Yakovenko <waker@users.sourceforge.net>2014-01-04 13:47:12 +0100
commit226f1af1a67221ca383c5ac9f8678f2e036a01ad (patch)
treee1d45b6fa11af33887429e2095c2540223382df9 /plugins/vfs_zip
parent227553719dbe3aa3db7cde81e8071e7d6c4b11ee (diff)
new API and vfs_zip patch, fixing bug #986, vfs.scandir not being able to handle pathes longer than 256 bytes because of dirent misuse
Diffstat (limited to 'plugins/vfs_zip')
-rw-r--r--plugins/vfs_zip/vfs_zip.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/plugins/vfs_zip/vfs_zip.c b/plugins/vfs_zip/vfs_zip.c
index eddd1cd0..65bcb25d 100644
--- a/plugins/vfs_zip/vfs_zip.c
+++ b/plugins/vfs_zip/vfs_zip.c
@@ -196,7 +196,7 @@ vfs_zip_scandir (const char *dir, struct dirent ***namelist, int (*selector) (co
(*namelist)[i] = malloc (sizeof (struct dirent));
memset ((*namelist)[i], 0, sizeof (struct dirent));
const char *nm = zip_get_name (z, i, 0);
- snprintf ((*namelist)[i]->d_name, sizeof ((*namelist)[i]->d_name), "zip://%s:%s", dir, nm);
+ snprintf ((*namelist)[i]->d_name, sizeof ((*namelist)[i]->d_name), "%s", nm);
}
zip_close (z);
@@ -211,10 +211,14 @@ vfs_zip_is_container (const char *fname) {
}
return 0;
}
+const char *
+vfs_zip_get_scheme_for_name (const char *fname) {
+ return scheme_names[0];
+}
static DB_vfs_t plugin = {
.plugin.api_vmajor = 1,
- .plugin.api_vminor = 0,
+ .plugin.api_vminor = 6,
.plugin.version_major = 1,
.plugin.version_minor = 0,
.plugin.type = DB_PLUGIN_VFS,
@@ -250,6 +254,7 @@ static DB_vfs_t plugin = {
.is_streaming = vfs_zip_is_streaming,
.is_container = vfs_zip_is_container,
.scandir = vfs_zip_scandir,
+ .get_scheme_for_name = vfs_zip_get_scheme_for_name,
};
DB_plugin_t *