protonscr

Duplicate dxvk-cache/logs due to case-(in)sensitivity

dxvkclosed
doitsujin/dxvk#2079 · opened 2021-06-04 by SirFrags · updated 2021-06-06 · 3 comments · github
SSirFrags 2021-06-04 github

GetModuleFileNameW returns a string with the execution path case and not the actual path case. This causes the file extension detection for dxvk-cache/logs to be unsuccessful. Example:

Running GAME.EXE as GAME.EXE results in a file prefix of "GAME.EXE" while running it as "GAME.exe" results in a prefix of "GAME" causing two sets of dxvk-cache/logs.

Software information

Windows (10)

Possible solution

dxvk_state_cache.cpp

getCacheFileName()

if (extp != std::string::npos && exeName.substr(extp + 1)== "exe")
  exeName.erase(extp);

change to:

std::string extLower = exeName.substr(extp + 1);
for (auto& c : extLower)
  c = std::tolower(c);

if (extp != std::string::npos && extLower == "exe")
  exeName.erase(extp);

log.cpp

getFileName()

Same fix

Mmisyltoad 2021-06-04 github
SSirFrags 2021-06-04 github

@Joshua-Ashton the pr fails to build but I made the intended changes locally and it fixes the problem - needs algorithm for std::transform instead of cctype

Mmisyltoad 2021-06-04 github

Well, cctype gives tolower :p

Ye, I just wrote that before i head out, will fix it up shortly.

Upstream links