Actions
Bug #2319
openimprove error message when secfile not found
Start date:
10/02/2026
Due date:
% Done:
0%
Estimated time:
Description
From server prompt, enter "load foo.sav" where "foo.sav" file does not exist. Get error message -
1: Error loading savefile '33c2c3.sav': In secfile_lookup_str_vec() [../utility/registry_ini.c:2531]: secfile '/Applications/Freeciv.app/Contents/share/freeciv/civ2civ3/game.ruleset' in section 'nullptr': "goods_good.helptext" entry doesn't exist.
The part -
...civ2civ3/game.ruleset' in section 'nullptr': "goods_good.helptext" entry doesn't exist.
is bogus. What's happening is that secfile_load() returns NULL if the file is not found, as well as when there's a secfile parse error. The calling routine tests secfile_load() return value and if it's null, calls "log_debug("Error reading '%s':\n%s", ... secfile_error());" and secfile_error() returns the most recent leftover secfile parse error, which is irrelevant when the file is not found. So some calls to secfile_load() should be preceded by calls to fc_stat() to give better error messages.
Files
Actions