Quote and escape ConfigFile keys when necessary

This commit is contained in:
Haoyu Qiu
2021-08-28 13:00:10 +08:00
parent dcf2d09231
commit 597d489a20
2 changed files with 10 additions and 3 deletions

View File

@@ -188,7 +188,7 @@ Error ConfigFile::_internal_save(FileAccess *file) {
for (OrderedHashMap<String, Variant>::Element F = E.get().front(); F; F = F.next()) {
String vstr;
VariantWriter::write_to_string(F.get(), vstr);
file->store_string(F.key() + "=" + vstr + "\n");
file->store_string(F.key().property_name_encode() + "=" + vstr + "\n");
}
}