Skip to content

Commit 6db7782

Browse files
committed
CoPyThEdAtAmOrE
1 parent 18744b6 commit 6db7782

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/common/FileSystem.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1602,7 +1602,11 @@ std::string ReadFile(Str::StringRef path, std::error_code& err)
16021602
bool isZip = pak.type == pakType_t::PAK_ZIP && !isBuiltin;
16031603

16041604
if (isBuiltin) {
1605-
return builtinPakMap[pak.name][path];
1605+
std::string content = builtinPakMap[pak.name][path];
1606+
std::string out;
1607+
out.resize(content.size());
1608+
memcpy(&out[0], content.data(), content.size());
1609+
return out;
16061610
} else if (isDir) {
16071611
// Open file
16081612
File file = RawPath::OpenRead(Path::Build(pak.path, it->first), err);

0 commit comments

Comments
 (0)