diff options
author | jmarshallnz <jcmarsha@gmail.com> | 2014-03-03 10:34:09 +1300 |
---|---|---|
committer | jmarshallnz <jcmarsha@gmail.com> | 2014-03-03 10:34:09 +1300 |
commit | 8a408a4e8e56d2a662bfc4cb6f05ca456ae4d030 (patch) | |
tree | 42c53ef1bfd9ccbfd8daec0b835163715763e056 | |
parent | c1978437caa1d6c44e5e3d83f97acddeab439e31 (diff) | |
parent | bfdefb2e9823dfc238d5f1c0f98d170f1fafe5cf (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.cpp | 10 |
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; |