Skip to content

Commit

Permalink
path.h fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Zielon committed Aug 13, 2021
1 parent 20072ce commit 0c02572
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Rasterizer/Rasterizer/src/path.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@ class Path
static std::filesystem::path Root(std::vector<std::string> segments)
{
auto root = std::filesystem::current_path();
while (root.string().find("CPURasterizer") != std::string::npos)
auto current = root.parent_path().filename();
while (current.string().find("CPURasterizer") == std::string::npos)
{
root = root.parent_path();
current = root.parent_path().filename();
}

root /= "CPURasterizer";
root = root.parent_path();

for (const auto segment : segments)
root /= segment;
Expand Down

0 comments on commit 0c02572

Please sign in to comment.