# include "config.h"
#endif
-#include <vlc/vlc.h>
+#include <vlc_common.h>
#include "http.h"
#include "vlc_strings.h"
if( ACL_LoadFile( p_acl, dir ) )
{
ACL_Destroy( p_acl );
+
+ struct stat st;
+ if( stat( dir, &st ) == 0 )
+ {
+ closedir( p_dir );
+ return VLC_EGENERIC;
+ }
p_acl = NULL;
}
if( b_index && ( p = strstr( f->file, "index." ) ) )
{
- asprintf( &psz_redir, "%s%s", f->name, p );
-
- msg_Dbg( p_intf, "redir=%s -> %s", psz_redir, f->name );
- f->p_redir2 = httpd_RedirectNew( p_sys->p_httpd_host,
- f->name, psz_redir );
+ if( asprintf( &psz_redir, "%s%s", f->name, p ) != -1 )
+ {
+ msg_Dbg( p_intf, "redir=%s -> %s", psz_redir, f->name );
+ f->p_redir2 = httpd_RedirectNew( p_sys->p_httpd_host,
+ f->name, psz_redir );
- free( psz_redir );
+ free( psz_redir );
+ }
}
}
}
s_temp = s_mrl + strlen( s_mrl );
}
- p_input = input_ItemNew( p_intf, s_mrl, psz_name );
+ p_input = input_item_New( p_intf, s_mrl, psz_name );
s_mrl = s_temp;
/* now we can take care of the options */
{
s_temp = s_mrl + strlen( s_mrl );
}
- input_ItemAddOption( p_input, s_mrl );
+ input_item_AddOption( p_input, s_mrl );
s_mrl = s_temp;
}
/**********************************************************************
* RealPath: parse ../, ~ and path stuff
**********************************************************************/
-char *RealPath( intf_thread_t *p_intf, const char *psz_src )
+char *RealPath( const char *psz_src )
{
char *psz_dir;
char *p;
if( psz_dir[0] == '~' )
{
char *dir;
- /* This is incomplete : we should also support the ~cmassiot/ syntax. */
- asprintf( &dir, "%s%s", p_intf->p_libvlc->psz_homedir, psz_dir + 1 );
+ asprintf( &dir, "%s%s", config_GetHomeDir(), psz_dir + 1 );
free( psz_dir );
psz_dir = dir;
}