summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/game.c b/src/game.c
index be3d40d..a8ab3e4 100644
--- a/src/game.c
+++ b/src/game.c
@@ -217,6 +217,7 @@ _db_game_xml_game_el_start(void *pv, const char *name, const char **attr)
XML_Parser p;
struct db_game *game;
char *lang;
+ int match;
db_dbg(" <%s> (game child)", name);
@@ -230,7 +231,9 @@ _db_game_xml_game_el_start(void *pv, const char *name, const char **attr)
return;
}
db_dbg(" lang=\"%s\"", lang);
- if (db_locale_match(lang) > game->best_name_match) {
+ match = db_locale_match(lang);
+ if (match > game->best_name_match) {
+ game->best_name_match = match;
goto name_ok;
}
db_xml_node_push(p, game, _db_game_xml_invalid_start,
@@ -255,7 +258,9 @@ _db_game_xml_game_el_start(void *pv, const char *name, const char **attr)
return;
}
db_dbg(" lang=\"%s\"", lang);
- if (db_locale_match(lang) > game->best_desc_match) {
+ match = db_locale_match(lang);
+ if (match > game->best_desc_match) {
+ game->best_name_match = match;
goto desc_ok;
}
db_xml_node_push(p, game, _db_game_xml_invalid_start,