[vlc-devel] commit: Fix directory detection with broken filesystems on Linux ( Rafaël Carré )

git version control git at videolan.org
Sun Mar 9 16:22:11 CET 2008


vlc | branch: master | Rafaël Carré <funman at videolan.org> | Sun Mar  9 12:59:53 2008 +0100| [24c38138a74528a6dd7643dd245c9e5af16330bd]

Fix directory detection with broken filesystems on Linux

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=24c38138a74528a6dd7643dd245c9e5af16330bd
---

 modules/access/directory.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/modules/access/directory.c b/modules/access/directory.c
index f4ceb26..7218bfd 100644
--- a/modules/access/directory.c
+++ b/modules/access/directory.c
@@ -146,6 +146,13 @@ static int Open( vlc_object_t *p_this )
 {
     access_t *p_access = (access_t*)p_this;
 
+    if( !p_access->psz_path )
+        return VLC_EGENERIC;
+
+    struct stat st;
+    if( !stat( p_access->psz_path, &st ) && !S_ISDIR( st.st_mode ) )
+        return VLC_EGENERIC;
+
     DIR *handle = OpenDir (p_this, p_access->psz_path);
     if (handle == NULL)
         return VLC_EGENERIC;




More information about the vlc-devel mailing list