From 3c5fb3bbc728762b69aeab5513004c8d28f557f7 Mon Sep 17 00:00:00 2001 From: rileylyman Date: Mon, 25 May 2020 14:25:34 -0700 Subject: [PATCH] skip extra newline in .tscn when renaming dependency (cherry picked from commit 40ce9bfc2d0a6246fd80eae52fc51be753587229) --- scene/resources/resource_format_text.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scene/resources/resource_format_text.cpp b/scene/resources/resource_format_text.cpp index 285f5037aa4..c39a3a5e1e3 100644 --- a/scene/resources/resource_format_text.cpp +++ b/scene/resources/resource_format_text.cpp @@ -800,6 +800,11 @@ Error ResourceInteractiveLoaderText::rename_dependencies(FileAccess *p_f, const 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();