Skip to content

Commit

Permalink
Update src/Security/BeamNG.cpp
Browse files Browse the repository at this point in the history
Co-authored-by: Tixx <[email protected]>
  • Loading branch information
enzofrnt and WiserTixx authored Dec 1, 2024
1 parent 6ebe19a commit 40da2bb
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Security/BeamNG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,17 +217,16 @@ bool CheckForGame(const std::string& libraryPath, const std::map<char, std::stri

std::string cleanPathStr = libraryPath.substr(2);
std::replace(cleanPathStr.begin(), cleanPathStr.end(), '\\', '/');
std::filesystem::path cleanLibraryPath = std::filesystem::path(cleanPathStr);

if (!cleanPathStr.empty() ){
if ( cleanPathStr[0] == '/') {
if (cleanPathStr[0] == '/') {
cleanPathStr.erase(0, 1);
}
if (cleanPathStr.back() == '/') {
cleanPathStr.pop_back();
}
}
cleanLibraryPath = std::filesystem::path(cleanPathStr);
std::filesystem::path cleanLibraryPath = std::filesystem::path(cleanPathStr);


debug("Cleaned library path: " + cleanLibraryPath.string());

Expand Down

0 comments on commit 40da2bb

Please sign in to comment.