From 6ad7be95253597f371b1ac8b979f75cee3c7a8b3 Mon Sep 17 00:00:00 2001 From: Viliam Mateicka Date: Sun, 28 Dec 2008 19:03:00 +0100 Subject: update: fixing empty filenames in archives --- src/archive/zip_plugin.c | 5 ++++- src/update.c | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/archive/zip_plugin.c b/src/archive/zip_plugin.c index 6ef53a625..76eec229d 100644 --- a/src/archive/zip_plugin.c +++ b/src/archive/zip_plugin.c @@ -56,7 +56,10 @@ zip_open(char * pathname) } while (zzip_dir_read(context->dir, &dirent)) { - context->list = g_slist_prepend( context->list, xstrdup(dirent.d_name)); + //add only files + if (dirent.st_size > 0) { + context->list = g_slist_prepend( context->list, xstrdup(dirent.d_name)); + } } return (struct archive_file *)context; diff --git a/src/update.c b/src/update.c index f51ccc7b6..776fa050b 100644 --- a/src/update.c +++ b/src/update.c @@ -296,6 +296,10 @@ update_archive_tree(struct directory *directory, char *name) //create directories first update_archive_tree(subdir, tmp+1); } else { + if (strlen(name) == 0) { + g_warning("archive returned directory only\n"); + return; + } //add file song = songvec_find(&directory->songs, name); if (song == NULL) { -- cgit v1.2.3