浏览代码

Quote and escape ConfigFile keys when necessary

(cherry picked from commit 597d489a20d3755dae4b92ac7667e058d68b3d83)
Haoyu Qiu 4 年之前
父节点
当前提交
e46d54ebec
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      core/io/config_file.cpp

+ 1 - 1
core/io/config_file.cpp

@@ -184,7 +184,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");
 		}
 	}