1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-08 18:53:12 +02:00

core: add a warning in header of configuration files to not edit by hand (closes #851)

This commit is contained in:
Sébastien Helleu
2016-11-21 22:29:35 +01:00
parent 2165610401
commit fe95a1c8a8
2 changed files with 17 additions and 6 deletions
+16 -6
View File
@@ -2459,13 +2459,23 @@ config_file_write_internal (struct t_config_file *config_file,
}
/* write header with name of config file and WeeChat version */
if (!string_fprintf (config_file->file, "#\n"))
goto error;
if (!string_fprintf (config_file->file,
"# %s -- %s\n#\n",
version_get_name (),
config_file->filename))
if (!string_fprintf (
config_file->file,
"#\n"
"# %s -- %s\n"
"#\n"
"# WARNING: It is NOT recommended to edit this file by hand,\n"
"# especially if WeeChat is running.\n"
"#\n"
"# Use /set or similar command to change settings in WeeChat.\n"
"#\n"
"# For more info, see: https://weechat.org/doc/quickstart\n"
"#\n",
version_get_name (),
config_file->filename))
{
goto error;
}
/* write all sections */
for (ptr_section = config_file->sections; ptr_section;