]> git.sesse.net Git - vlc/commitdiff
Use Unicode wrappers to open HTTP interface files
authorRémi Denis-Courmont <rem@videolan.org>
Sat, 11 Nov 2006 17:28:34 +0000 (17:28 +0000)
committerRémi Denis-Courmont <rem@videolan.org>
Sat, 11 Nov 2006 17:28:34 +0000 (17:28 +0000)
modules/control/http/http.c
modules/control/http/util.c

index 9a8bdc70c23ca47b469e6f46a5ed65af7e8eb0d3..854e00cff59a050757e433a2f272e7f12123c2d7 100644 (file)
@@ -639,8 +639,7 @@ int  E_(HttpCallback)( httpd_file_sys_t *p_args,
     char **pp_data = (char **)_pp_data;
     FILE *f;
 
-    /* FIXME: do we need character encoding translation here? */
-    if( ( f = fopen( p_args->file, "r" ) ) == NULL )
+    if( ( f = utf8_fopen( p_args->file, "r" ) ) == NULL )
     {
         Callback404( p_args, pp_data, pi_data );
         return VLC_SUCCESS;
index 99b184e33378715721eb5ca8762c4e80e59c7f1b..8b53022f5f6b0a24fa0e1e03c3b33b24479c020c 100644 (file)
@@ -213,11 +213,10 @@ int E_(ParseDirectory)( intf_thread_t *p_intf, char *psz_root,
             httpd_file_sys_t *f = NULL;
             httpd_handler_sys_t *h = NULL;
             vlc_bool_t b_index;
-            char *psz_file, *psz_name, *psz_ext;
+            char *psz_name, *psz_ext;
 
-            psz_file = E_(FromUTF8)( p_intf, dir );
             psz_name = E_(FileToUrl)( &dir[strlen( psz_root )], &b_index );
-            psz_ext = strrchr( psz_file, '.' );
+            psz_ext = strrchr( dir, '.' );
             if( psz_ext != NULL )
             {
                 int i;
@@ -243,7 +242,7 @@ int E_(ParseDirectory)( intf_thread_t *p_intf, char *psz_root,
             f->p_file = NULL;
             f->p_redir = NULL;
             f->p_redir2 = NULL;
-            f->file = psz_file;
+            f->file = strdup (dir);
             f->name = psz_name;
             f->b_html = strstr( &dir[strlen( psz_root )], ".htm" ) || strstr( &dir[strlen( psz_root )], ".xml" ) ? VLC_TRUE : VLC_FALSE;