Permalink
Browse files

Windows: Correctly buildfix Windows XP.

Should run properly now - dumb mistake.
  • Loading branch information...
unknownbrackets committed Aug 18, 2018
1 parent ec5b0c2 commit 8a154dab707f50cd72ee9aa3a81cdeb534965172
Showing with 4 additions and 12 deletions.
  1. +1 −1 Common/FileUtil.cpp
  2. +3 −11 Core/Config.cpp
View
@@ -121,7 +121,7 @@ std::string ResolvePath(const std::string &path) {
if (hFile == INVALID_HANDLE_VALUE) {
wcscpy_s(buf, BUF_SIZE - 1, input.c_str());
} else {
int result = GetFinalPathNameByHandle(hFile, buf, BUF_SIZE - 1, FILE_NAME_NORMALIZED | VOLUME_NAME_DOS);
int result = getFinalPathNameByHandleW(hFile, buf, BUF_SIZE - 1, FILE_NAME_NORMALIZED | VOLUME_NAME_DOS);
if (result >= BUF_SIZE || result == 0)
wcscpy_s(buf, BUF_SIZE - 1, input.c_str());
}
View
@@ -1210,18 +1210,10 @@ void Config::AddRecent(const std::string &file) {
if (iMaxRecent <= 0)
return;
const std::string filename = File::ResolvePath(file);
for (auto iter = recentIsos.begin(); iter != recentIsos.end();) {
const std::string recent = File::ResolvePath(*iter);
if (filename == recent) {
// Note that the increment-erase idiom doesn't work with vectors.
iter = recentIsos.erase(iter);
// We'll add it back below.
} else {
iter++;
}
}
// We'll add it back below. This makes sure it's at the front, and only once.
RemoveRecent(file);
const std::string filename = File::ResolvePath(file);
recentIsos.insert(recentIsos.begin(), filename);
if ((int)recentIsos.size() > iMaxRecent)
recentIsos.resize(iMaxRecent);

0 comments on commit 8a154da

Please sign in to comment.