fix(relinker): normalize input prefix paths

This commit is contained in:
MarcZX10 committed 2026-10-20 21:07:53 +00:00
1 parent fc046e621b
commit 8625b4802b
1 file changed
+5 -1
+5 -1
View File
@@ -10,7 +10,11 @@ namespace Io {
std::vector<std::uint8_t> FileReader::ReadPrefix(const std::string& path, const std::size_t size) const {
if (size > static_cast<std::size_t>(std::numeric_limits<std::streamsize>::max()))
throw Domain::RelinkerException("File prefix is too large: " + path);
std::ifstream f(path, std::ios::binary);
const auto native = NativePath(path);
std::error_code error;
if (!std::filesystem::is_regular_file(native, error))
throw Domain::RelinkerException("Cannot open file: " + path);
std::ifstream f(native, std::ios::binary);
if (!f)
throw Domain::RelinkerException("Cannot open file: " + path);
std::vector<std::uint8_t> buf(size);