summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2023-06-17 13:13:11 +0200
committerSébastien Helleu <flashcode@flashtux.org>2023-06-17 13:13:11 +0200
commite1d1831fa8aa06e9c7968792b3d1b8f656ec9903 (patch)
treefbd611583b603d3db488a79fbadff22295fcb7d3 /src
parent3e42d95f4083243782217b7d0d209e2219372058 (diff)
downloadweechat-e1d1831fa8aa06e9c7968792b3d1b8f656ec9903.zip
core: ignore rest of config file if config version is invalid or not supported
Diffstat (limited to 'src')
-rw-r--r--src/core/wee-config-file.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/core/wee-config-file.c b/src/core/wee-config-file.c
index 327587855..fc2123ffa 100644
--- a/src/core/wee-config-file.c
+++ b/src/core/wee-config-file.c
@@ -3474,25 +3474,29 @@ config_file_read_internal (struct t_config_file *config_file, int reload)
{
gui_chat_printf (
NULL,
- _("%sWarning: %s, line %d: invalid config "
- "version: %s"),
+ _("%sError: %s, line %d: invalid config "
+ "version: \"%s\" => "
+ "rest of file is IGNORED, default options are used"),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
filename, line_number,
line);
+ goto end_file;
}
else
{
config_file->version_read = version;
if (config_file->version_read > config_file->version)
{
- gui_chat_printf (NULL,
- _("%sWarning: %s, version read (%d) is "
- "newer than supported version (%d), "
- "options may be broken!"),
- gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
- filename,
- config_file->version_read,
- config_file->version);
+ gui_chat_printf (
+ NULL,
+ _("%sError: %s, version read (%d) is newer than "
+ "supported version (%d) => "
+ "rest of file is IGNORED, default options are used"),
+ gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
+ filename,
+ config_file->version_read,
+ config_file->version);
+ goto end_file;
}
}
goto end_line;
@@ -3582,6 +3586,7 @@ config_file_read_internal (struct t_config_file *config_file, int reload)
free (value);
}
+end_file:
fclose (config_file->file);
config_file->file = NULL;
free (filename);