summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrileylyman <rileylyman@berkeley.edu>2020-05-25 14:25:34 -0700
committerrileylyman <rileylyman@berkeley.edu>2020-05-25 14:25:34 -0700
commit40ce9bfc2d0a6246fd80eae52fc51be753587229 (patch)
tree4c9a42bf054efab1f247073208160a640f9607c5
parent242b7151445ae98b782c9c70644d47f8a5630094 (diff)
skip extra newline in .tscn when renaming dependency
-rw-r--r--scene/resources/resource_format_text.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/scene/resources/resource_format_text.cpp b/scene/resources/resource_format_text.cpp
index 93db8b725f..c7aa2c2ddc 100644
--- a/scene/resources/resource_format_text.cpp
+++ b/scene/resources/resource_format_text.cpp
@@ -838,6 +838,11 @@ Error ResourceLoaderText::rename_dependencies(FileAccess *p_f, const String &p_p
f->seek(tag_end);
uint8_t c = f->get_8();
+ if (c == '\n' && !f->eof_reached()) {
+ // Skip first newline character since we added one
+ c = f->get_8();
+ }
+
while (!f->eof_reached()) {
fw->store_8(c);
c = f->get_8();