]> git.sesse.net Git - vlc/commitdiff
Fix directory detection with broken filesystems on Linux
authorRafaël Carré <funman@videolan.org>
Sun, 9 Mar 2008 11:59:53 +0000 (12:59 +0100)
committerRafaël Carré <funman@videolan.org>
Sun, 9 Mar 2008 12:18:37 +0000 (13:18 +0100)
modules/access/directory.c

index f4ceb264ce1df8b23636d22de461af7a2fc1b5c1..7218bfd293f53531356e24983497df955d862e91 100644 (file)
@@ -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;