1
mirror of https://code.videolan.org/videolan/vlc synced 2024-09-04 09:11:33 +02:00

* modules/control/http/mvar.c: Handle file extensions case-insensitively.

This commit is contained in:
Christophe Massiot 2005-12-15 18:11:58 +00:00
parent 938b3718f4
commit d26257e044

View File

@ -541,8 +541,7 @@ mvar_t *E_(mvar_FileSetNew)( intf_thread_t *p_intf, char *name,
{
struct dirent *p_dir_content = pp_dir_content[i];
mvar_t *f;
const char *psz_ext;
char *psz_name, *psz_tmp;
char *psz_name, *psz_tmp, *psz_ext;
if( !strcmp( p_dir_content->d_name, "." ) )
{
@ -573,9 +572,16 @@ mvar_t *E_(mvar_FileSetNew)( intf_thread_t *p_intf, char *name,
psz_name = E_(FromUTF8)( p_intf, psz_tmp );
free( psz_tmp );
/* put file extension in 'ext' */
/* put lower-case file extension in 'ext' */
psz_ext = strrchr( psz_name, '.' );
E_(mvar_AppendNewVar)( f, "ext", psz_ext != NULL ? psz_ext + 1 : "" );
psz_tmp = psz_ext = strdup( psz_ext != NULL ? psz_ext + 1 : "" );
while ( *psz_tmp != '\0' )
{
*psz_tmp = tolower( *psz_tmp );
psz_tmp++;
}
E_(mvar_AppendNewVar)( f, "ext", psz_ext );
free( psz_ext );
#if defined( WIN32 )
if( psz_dir[0] == '\0' || (psz_dir[0] == '\\' && psz_dir[1] == '\0') )