Permalink
Browse files

udf: UDFFile root to behave correctly as folder to be readable by lib…

…dvdnav
  • Loading branch information...
Voyager1 committed Jan 3, 2014
1 parent deb47e9 commit 445e95a7cd0493ba7db8d2f2712a373bf3108263
Showing with 7 additions and 1 deletion.
  1. +7 −1 xbmc/filesystem/UDFFile.cpp
@@ -50,7 +50,7 @@ CUDFFile::~CUDFFile()
//*********************************************************************************************
bool CUDFFile::Open(const CURL& url)
{
- if(!m_udfIsoReaderLocal.Open(url.GetHostName()))
+ if(!m_udfIsoReaderLocal.Open(url.GetHostName()) || url.GetFileName().empty())
return false;
m_hFile = m_udfIsoReaderLocal.OpenFile(url.GetFileName());
@@ -125,6 +125,12 @@ int CUDFFile::Stat(const CURL& url, struct __stat64* buffer)
if(!m_udfIsoReaderLocal.Open(url.GetHostName()))
return -1;
+ if (url.GetFileName().empty())
+ {
+ buffer->st_mode = _S_IFDIR;
+ return 0;
+ }
+
m_hFile = m_udfIsoReaderLocal.OpenFile(url.GetFileName());
if (m_hFile != INVALID_HANDLE_VALUE)
{

0 comments on commit 445e95a

Please sign in to comment.