Project

General

Profile

Actions

Bug #2319

open

improve error message when secfile not found

Added by Dean Brown 13 days ago. Updated 8 days ago.

Status:
In Review
Priority:
Normal
Category:
Server
Target version:
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

2319_Part2.patch (960 Bytes) 2319_Part2.patch Dean Brown, 10/06/2026 05:48 AM
2319_Main_Part1.patch (1.91 KB) 2319_Main_Part1.patch Dean Brown, 10/06/2026 05:48 AM
2319_S3_3_Part1.patch (1.91 KB) 2319_S3_3_Part1.patch Dean Brown, 10/06/2026 05:48 AM

Related issues 2 (2 open — 0 closed)

Blocks Feature #2340: fc_stat(): Accept nullptr bufferNew10/06/2026

Actions
Blocked by Feature #2323: fcdb.c : NULL -> nullptrIn ReviewMarko Lindqvist10/04/2026

Actions
Actions

Also available in: Atom PDF