unix: handle edge case where path does not exist

fixes crash when passing an invalid path with the "-g" launch option
the algorithm would recurse up the tree infinitely looking for blank parent directories
probably fixes more things
This commit is contained in:
goeiecool9999 2026-04-03 01:07:37 +02:00
parent 2913a8ca7a
commit a1d47c37b6

View File

@ -7,6 +7,9 @@ fs::path findPathCI(const fs::path& path)
fs::path fName = path.filename();
fs::path parentPath = path.parent_path();
if (parentPath.empty())
return path;
if (!fs::exists(parentPath))
{
auto CIParent = findPathCI(parentPath);