From 21f40a83622d4fba59e4e27fd49188b1efe71cda Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sat, 17 Apr 2021 14:02:15 -0500 Subject: [PATCH] [nostalgia/tools] Revert writeFileBuff path to ox::String --- src/nostalgia/tools/pack.cpp | 6 +++--- src/nostalgia/tools/pack/pack.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/nostalgia/tools/pack.cpp b/src/nostalgia/tools/pack.cpp index 4b4aa86a..815cb241 100644 --- a/src/nostalgia/tools/pack.cpp +++ b/src/nostalgia/tools/pack.cpp @@ -13,9 +13,9 @@ #include "pack/pack.hpp" -static ox::Error writeFileBuff(const std::string_view path, ox::Vector &buff) { +static ox::Error writeFileBuff(const ox::String &path, ox::Vector &buff) { try { - std::ofstream f(path, std::ios::binary); + std::ofstream f(path.c_str(), std::ios::binary); f.write(buff.data(), static_cast(buff.size())); } catch (const std::fstream::failure&) { return OxError(2, "failed to write file"); @@ -45,7 +45,7 @@ static ox::Error run(const ox::ClArgs &args) { oxOutf("new size: {}\n", dstSize); buff.resize(dstSize); - oxReturnError(writeFileBuff(argDst.c_str(), buff)); + oxReturnError(writeFileBuff(argDst, buff)); return OxError(0); } diff --git a/src/nostalgia/tools/pack/pack.cpp b/src/nostalgia/tools/pack/pack.cpp index d3b34542..8f992479 100644 --- a/src/nostalgia/tools/pack/pack.cpp +++ b/src/nostalgia/tools/pack/pack.cpp @@ -88,7 +88,7 @@ ox::Error copy(ox::PassThroughFS *src, ox::FileSystem32 *dest, ox::String path) oxOutf("copying directory: {}\n", path); ox::Vector verificationPairs; // copy - oxReturnError(src->ls(path.c_str(), [&verificationPairs, src, dest, path](ox::String name, ox::InodeId_t) { + oxReturnError(src->ls(path.c_str(), [&verificationPairs, src, dest, path](const char *name, ox::InodeId_t) { auto currentFile = path + name; if (currentFile == "/.nostalgia") { return OxError(0);