Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
enzofrnt committed Dec 1, 2024
2 parents 6f5d927 + 40da2bb commit cf7a193
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 cf7a193

Please sign in to comment.