]> git.sesse.net Git - vlc/commitdiff
HTTP interface: do not look for stuff in current directory
authorRémi Denis-Courmont <rdenis@simphalempin.com>
Tue, 12 Aug 2008 20:20:39 +0000 (23:20 +0300)
committerRémi Denis-Courmont <rdenis@simphalempin.com>
Tue, 12 Aug 2008 20:22:26 +0000 (23:22 +0300)
This is essentially the same problem as --plugin-path (albeit hopefully
with much less disastrous potential effects), with the same
inconvenience for developpers.

modules/control/http/http.c

index abb3eb52637394eb97e20123dadcae3df3f6b0a0..c6f2ddbdf2e551bb60e3315a0e84bc34f469f48d 100644 (file)
@@ -95,24 +95,6 @@ int  ArtCallback( httpd_handler_sys_t *p_args,
                           char *psz_remote_addr, char *psz_remote_host,
                           uint8_t **pp_data, int *pi_data );
 
-/*****************************************************************************
- * Local functions
- *****************************************************************************/
-#if !defined(__APPLE__) && !defined(SYS_BEOS) && !defined(WIN32)
-static int DirectoryCheck( const char *psz_dir )
-{
-    struct stat   stat_info;
-
-    if( ( utf8_stat( psz_dir, &stat_info ) == -1 )
-      || !S_ISDIR( stat_info.st_mode ) )
-    {
-        return VLC_EGENERIC;
-    }
-    return VLC_SUCCESS;
-}
-#endif
-
-
 /*****************************************************************************
  * Activate: initialize and create stuff
  *****************************************************************************/
@@ -246,42 +228,13 @@ static int Open( vlc_object_t *p_this )
     p_sys->i_files  = 0;
     p_sys->pp_files = NULL;
 
-#if defined(__APPLE__) || defined(SYS_BEOS) || defined(WIN32)
-    if ( ( psz_src = config_GetPsz( p_intf, "http-src" )) == NULL )
-    {
-        const char * psz_vlcpath = config_GetDataDir();
-        psz_src = malloc( strlen(psz_vlcpath) + strlen("/http" ) + 1 );
-        if( !psz_src ) return VLC_ENOMEM;
-        sprintf( psz_src, "%s/http", psz_vlcpath );
-    }
-#else
     psz_src = config_GetPsz( p_intf, "http-src" );
-
     if( ( psz_src == NULL ) || ( *psz_src == '\0' ) )
     {
         const char *data_path = config_GetDataDir ();
-        char buf[strlen (data_path) + sizeof ("/http")];
-        snprintf (buf, sizeof (buf), "%s/http", data_path);
-
-        const char const* ppsz_paths[] = {
-            "share/http",
-            "../share/http",
-            buf,
-            NULL
-        };
-        unsigned i;
-
-        free( psz_src );
-        psz_src = NULL;
-
-        for( i = 0; ppsz_paths[i] != NULL; i++ )
-            if( !DirectoryCheck( ppsz_paths[i] ) )
-            {
-                psz_src = strdup( ppsz_paths[i] );
-                break;
-            }
+        if( asprintf( &psz_src, "%s/http", data_path ) == -1 )
+            psz_src = NULL;
     }
-#endif
 
     if( !psz_src || *psz_src == '\0' )
     {