From 69244f673620b2fcda3ab6cff790f6a694789d87 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sun, 9 Oct 2022 15:42:28 +0300 Subject: [PATCH 44/44] Fix translating names of nations from the core set Reported by carbsrule and Alexandro Ignatiev See osdn #45761 Signed-off-by: Marko Lindqvist --- server/ruleset.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/server/ruleset.c b/server/ruleset.c index 94bd4c27cc..e19b3ce84d 100644 --- a/server/ruleset.c +++ b/server/ruleset.c @@ -4636,8 +4636,7 @@ static bool load_nation_names(struct section_file *file, if (!strcmp("freeciv-core", domain)) { pl->translation_domain = NULL; } else if (!strcmp("freeciv-nations", domain)) { - pl->translation_domain = fc_malloc(strlen(domain) + 1); - strcpy(pl->translation_domain, domain); + pl->translation_domain = fc_strdup(domain); } else { ruleset_error(NULL, LOG_ERROR, "Unsupported translation domain \"%s\" for %s", @@ -4646,11 +4645,11 @@ static bool load_nation_names(struct section_file *file, break; } - if (!ruleset_load_names(&pl->adjective, domain, file, sec_name)) { + if (!ruleset_load_names(&pl->adjective, pl->translation_domain, file, sec_name)) { ok = FALSE; break; } - name_set(&pl->noun_plural, domain, noun_plural); + name_set(&pl->noun_plural, pl->translation_domain, noun_plural); /* Check if nation name is already defined. */ for (j = 0; j < i && ok; j++) { -- 2.35.1