bspfile.cc: fix infinite loop

This commit is contained in:
Eric Wasylishen 2023-09-11 18:47:56 -06:00
parent 741b0b77ed
commit 486f63f2d8
1 changed files with 3 additions and 1 deletions

View File

@ -1517,7 +1517,9 @@ public:
bool found_maps_folder = false;
fs::path olddir = gamedir = source;
while (!gamedir.empty()) {
// NOTE: parent_path() of C:/ is C:/ and this is considered non-empty
// its relative_path() (the part after the drive letter) is empty, though
while (!gamedir.relative_path().empty()) {
gamedir = fs::weakly_canonical(gamedir).parent_path();
if (string_iequals(gamedir.filename().generic_string(), MAPS_FOLDER)) {