From 0d122ce45998b33e923ac406129f64b5e9f3affb Mon Sep 17 00:00:00 2001 From: kobewi Date: Wed, 9 Nov 2022 14:00:51 +0100 Subject: Allow to escape closing brackets in CFG tags --- core/io/config_file.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/io') diff --git a/core/io/config_file.cpp b/core/io/config_file.cpp index f84a95347a..604cf67c1d 100644 --- a/core/io/config_file.cpp +++ b/core/io/config_file.cpp @@ -208,7 +208,7 @@ Error ConfigFile::_internal_save(Ref file) { file->store_string("\n"); } if (!E.key.is_empty()) { - file->store_string("[" + E.key + "]\n\n"); + file->store_string("[" + E.key.replace("]", "\\]") + "]\n\n"); } for (const KeyValue &F : E.value) { @@ -308,7 +308,7 @@ Error ConfigFile::_parse(const String &p_path, VariantParser::Stream *p_stream) if (!assign.is_empty()) { set_value(section, assign, value); } else if (!next_tag.name.is_empty()) { - section = next_tag.name; + section = next_tag.name.replace("\\]", "]"); } } -- cgit v1.2.3