aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjmarshallnz <jcmarsha@gmail.com>2014-03-03 10:34:09 +1300
committerjmarshallnz <jcmarsha@gmail.com>2014-03-03 10:34:09 +1300
commit8a408a4e8e56d2a662bfc4cb6f05ca456ae4d030 (patch)
tree42c53ef1bfd9ccbfd8daec0b835163715763e056
parentc1978437caa1d6c44e5e3d83f97acddeab439e31 (diff)
parentbfdefb2e9823dfc238d5f1c0f98d170f1fafe5cf (diff)
Merge pull request #4299 from Voyager1/zip-rootisdir
Allow ZIP root to be viewed as directory to enable playback of files contained
-rw-r--r--xbmc/filesystem/ZipFile.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/xbmc/filesystem/ZipFile.cpp b/xbmc/filesystem/ZipFile.cpp
index e34e229dc2..8839ddea06 100644
--- a/xbmc/filesystem/ZipFile.cpp
+++ b/xbmc/filesystem/ZipFile.cpp
@@ -266,7 +266,15 @@ int CZipFile::Stat(struct __stat64 *buffer)
int CZipFile::Stat(const CURL& url, struct __stat64* buffer)
{
if (!g_ZipManager.GetZipEntry(url.Get(),mZipItem))
- return -1;
+ {
+ if (url.GetFileName().empty() && CFile::Exists(url.GetHostName()))
+ { // when accessing the zip "root" recognize it as a directory
+ buffer->st_mode = _S_IFDIR;
+ return 0;
+ }
+ else
+ return -1;
+ }
memset(buffer, 0, sizeof(struct __stat64));
buffer->st_gid = 0;