A few fixes for code to find luprex root

This commit is contained in:
2023-05-10 19:39:23 -04:00
parent 64b4fc465d
commit e98ad5bc62
2 changed files with 5 additions and 4 deletions

View File

@@ -95,7 +95,7 @@ static std::vector<std::string> parse_control_lst(std::string_view ctrl) {
static std::string read_file(const std::filesystem::path &fn, std::string &err) {
std::ifstream t(fn);
if (t.fail()) {
err = std::string("Could not open ") + std::string(fn);
err = std::string("Could not open ") + fn.u8string();
return "";
}
t.seekg(0, std::ios::end);
@@ -104,7 +104,7 @@ static std::string read_file(const std::filesystem::path &fn, std::string &err)
t.seekg(0);
t.read(&result[0], size);
if ((t.fail()) || (size_t(t.tellg()) != size)) {
err = std::string("Could not read ") + std::string(fn);
err = std::string("Could not read ") + fn.u8string();
return "";
}
err = "";
@@ -169,7 +169,7 @@ std::string package_lua_source(const std::filesystem::path &base, std::ostream *
for (int i = 0; i < int(names.size()); i++) {
std::filesystem::path lfn = base / "lua" / names[i];
if (!sbwrite_file(s, lfn)) {
return std::string("Cannot read source file: ") + std::string(lfn);
return std::string("Cannot read source file: ") + lfn.u8string();
}
}
return "";