Commit ed7ec2db authored by hpi1's avatar hpi1

Use lower case letters for language codes

parent 5c9520ff
......@@ -117,6 +117,7 @@ static void _findMetaXMLfiles(META_ROOT *meta, const char *device_path)
meta->dl_entries[i].filename = str_printf("%s", ent.d_name);
strncpy(meta->dl_entries[i].language_code, ent.d_name+5,3);
meta->dl_entries[i].language_code[3] = '\0';
str_tolower(meta->dl_entries[i].language_code);
}
}
dir_close(dir);
......@@ -190,7 +191,7 @@ META_DL *meta_get(META_ROOT *meta_root, const char *language_code)
if (language_code) {
for (i = 0; i < meta_root->dl_count; i++) {
if (strcasecmp(language_code, meta_root->dl_entries[i].language_code) == 0) {
if (strcmp(language_code, meta_root->dl_entries[i].language_code) == 0) {
return &meta_root->dl_entries[i];
}
}
......@@ -198,7 +199,7 @@ META_DL *meta_get(META_ROOT *meta_root, const char *language_code)
}
for (i = 0; i < meta_root->dl_count; i++) {
if (strcasecmp(DEFAULT_LANGUAGE, meta_root->dl_entries[i].language_code) == 0) {
if (strcmp(DEFAULT_LANGUAGE, meta_root->dl_entries[i].language_code) == 0) {
BD_DEBUG(DBG_DIR, "using default disclib language '"DEFAULT_LANGUAGE"'\n");
return &meta_root->dl_entries[i];
}
......
......@@ -22,6 +22,7 @@
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <ctype.h>
char * str_printf(const char *fmt, ...)
{
......@@ -78,3 +79,11 @@ uint32_t str_to_uint32(const char *s, int n)
return val;
}
void str_tolower(char *s)
{
while (*s) {
*s = tolower(*s);
s++;
}
}
......@@ -27,5 +27,6 @@
BD_PRIVATE char * str_printf(const char *fmt, ...) BD_ATTR_FORMAT_PRINTF(1,2) BD_ATTR_MALLOC;
BD_PRIVATE uint32_t str_to_uint32(const char *s, int n);
BD_PRIVATE void str_tolower(char *s);
#endif // STRUTL_H_
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