Commit 8ad8bb3d authored by Marian Durkovic's avatar Marian Durkovic Committed by Derk-Jan Hartman

Ignore case when comparing ISO-639 language codes

Signed-off-by: default avatarDerk-Jan Hartman <hartman@videolan.org>
(cherry picked from commit 58b66d49)
parent 65839420
...@@ -49,7 +49,7 @@ const iso639_lang_t * GetLang_1( const char * psz_code ) ...@@ -49,7 +49,7 @@ const iso639_lang_t * GetLang_1( const char * psz_code )
const iso639_lang_t *p_lang; const iso639_lang_t *p_lang;
for( p_lang = p_languages; p_lang->psz_eng_name; p_lang++ ) for( p_lang = p_languages; p_lang->psz_eng_name; p_lang++ )
if( !strncmp( p_lang->psz_iso639_1, psz_code, 2 ) ) if( !strncasecmp( p_lang->psz_iso639_1, psz_code, 2 ) )
return p_lang; return p_lang;
return &unknown_language; return &unknown_language;
...@@ -60,7 +60,7 @@ const iso639_lang_t * GetLang_2T( const char * psz_code ) ...@@ -60,7 +60,7 @@ const iso639_lang_t * GetLang_2T( const char * psz_code )
const iso639_lang_t *p_lang; const iso639_lang_t *p_lang;
for( p_lang = p_languages; p_lang->psz_eng_name; p_lang++ ) for( p_lang = p_languages; p_lang->psz_eng_name; p_lang++ )
if( !strncmp( p_lang->psz_iso639_2T, psz_code, 3 ) ) if( !strncasecmp( p_lang->psz_iso639_2T, psz_code, 3 ) )
return p_lang; return p_lang;
return &unknown_language; return &unknown_language;
...@@ -71,7 +71,7 @@ const iso639_lang_t * GetLang_2B( const char * psz_code ) ...@@ -71,7 +71,7 @@ const iso639_lang_t * GetLang_2B( const char * psz_code )
const iso639_lang_t *p_lang; const iso639_lang_t *p_lang;
for( p_lang = p_languages; p_lang->psz_eng_name; p_lang++ ) for( p_lang = p_languages; p_lang->psz_eng_name; p_lang++ )
if( !strncmp( p_lang->psz_iso639_2B, psz_code, 3 ) ) if( !strncasecmp( p_lang->psz_iso639_2B, psz_code, 3 ) )
return p_lang; return p_lang;
return &unknown_language; return &unknown_language;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment