From 14aa8aaf636b657eb7c107b287630317dc8567ac Mon Sep 17 00:00:00 2001 From: goeiecool9999 <> Date: Fri, 9 Sep 2022 12:09:59 +0200 Subject: [PATCH] Fix infinite recursion on non-existing directory --- src/Common/unix/FileStream_unix.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Common/unix/FileStream_unix.cpp b/src/Common/unix/FileStream_unix.cpp index 39379d83..85649b15 100644 --- a/src/Common/unix/FileStream_unix.cpp +++ b/src/Common/unix/FileStream_unix.cpp @@ -7,7 +7,11 @@ fs::path findPathCI(const fs::path& path) fs::path fName = path.filename(); fs::path parentPath = path.parent_path(); if (!fs::exists(parentPath)) - return findPathCI(findPathCI(parentPath) / fName); + { + auto CIParent = findPathCI(parentPath); + if (fs::exists(CIParent)) + return findPathCI(CIParent / fName); + } std::error_code listErr; for (auto&& dirEntry : fs::directory_iterator(parentPath, listErr))