Windows: Fix loading files with a long path.

Better handling of a path which exceeds MAX_PATH when converted into UTF-8.
This commit is contained in:
Akira Miyakoda 2018-01-19 18:22:06 +09:00
parent 3aca9e3ca4
commit 8eeee7e1ab

View file

@ -404,18 +404,6 @@ namespace MainWindow {
Core_EnableStepping(false);
}
// TODO: What is this for / what does it fix?
if (browseDialog->GetType() != W32Util::AsyncBrowseDialog::DIR) {
// Decode the filename with fullpath.
char drive[MAX_PATH];
char dir[MAX_PATH];
char fname[MAX_PATH];
char ext[MAX_PATH];
_splitpath(filename.c_str(), drive, dir, fname, ext);
filename = std::string(drive) + std::string(dir) + std::string(fname) + std::string(ext);
}
filename = ReplaceAll(filename, "\\", "/");
NativeMessageReceived("boot", filename.c_str());
}