diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2016-11-21 22:29:35 +0100 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2016-11-21 22:29:35 +0100 |
commit | fe95a1c8a86e1e1741a2769d7570f88a818e9b3e (patch) | |
tree | 2dbd7fca5cf2fddf09759be3c7e92d3593b1aa65 /src/core | |
parent | 2165610401425889302f13c7074aa766bc9171d3 (diff) | |
download | weechat-fe95a1c8a86e1e1741a2769d7570f88a818e9b3e.zip |
core: add a warning in header of configuration files to not edit by hand (closes #851)
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/wee-config-file.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/core/wee-config-file.c b/src/core/wee-config-file.c index 7a6f3591f..156e3d4bb 100644 --- a/src/core/wee-config-file.c +++ b/src/core/wee-config-file.c @@ -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; |