From 945a55f94a4ba32e4cd1f6f9a7f606f6af368921 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sat, 28 Sep 2024 21:10:13 -0500 Subject: [PATCH] [studio] Fix Project to cut off correct end of OC data --- src/olympic/studio/modlib/include/studio/project.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/olympic/studio/modlib/include/studio/project.hpp b/src/olympic/studio/modlib/include/studio/project.hpp index 140cb9ee..203cf1df 100644 --- a/src/olympic/studio/modlib/include/studio/project.hpp +++ b/src/olympic/studio/modlib/include/studio/project.hpp @@ -131,9 +131,12 @@ class Project { template ox::Error Project::writeObj(ox::StringViewCR path, T const&obj, ox::ClawFormat fmt) noexcept { oxRequireM(buff, ox::writeClaw(obj, fmt)); + if (fmt == ox::ClawFormat::Organic) { + buff.pop_back(); + } // write to FS oxReturnError(mkdir(parentDir(path))); - oxReturnError(writeBuff(path, ox::BufferView{buff} + (fmt == ox::ClawFormat::Organic))); + oxReturnError(writeBuff(path, buff)); // write type descriptor if (m_typeStore.get().error) { oxReturnError(ox::buildTypeDef(m_typeStore, obj));