From 22abeff592957b0fab974eaaa9bd0741f13a6ef4 Mon Sep 17 00:00:00 2001 From: Bojidar Marinov Date: Mon, 3 Jun 2019 16:54:41 +0300 Subject: [PATCH] Escape node names when saving to .tscn Fixes #29401 (cherry picked from commit cc004485bc994c39065a8a4a6cff861a383f6fb0) --- scene/resources/resource_format_text.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scene/resources/resource_format_text.cpp b/scene/resources/resource_format_text.cpp index b6efca9acc3..f27f9b82150 100644 --- a/scene/resources/resource_format_text.cpp +++ b/scene/resources/resource_format_text.cpp @@ -1664,15 +1664,15 @@ Error ResourceFormatSaverTextInstance::save(const String &p_path, const RES &p_r Vector groups = state->get_node_groups(i); String header = "[node"; - header += " name=\"" + String(name) + "\""; + header += " name=\"" + String(name).c_escape() + "\""; if (type != StringName()) { header += " type=\"" + String(type) + "\""; } if (path != NodePath()) { - header += " parent=\"" + String(path.simplified()) + "\""; + header += " parent=\"" + String(path.simplified()).c_escape() + "\""; } if (owner != NodePath() && owner != NodePath(".")) { - header += " owner=\"" + String(owner.simplified()) + "\""; + header += " owner=\"" + String(owner.simplified()).c_escape() + "\""; } if (index >= 0) { header += " index=\"" + itos(index) + "\"";