use fs::absolute instead of fs::canonical

To allow users to work with symlinks in user_files_path

Signed-off-by: Duc Canh Le <duccanh.le@ahrefs.com>
This commit is contained in:
Duc Canh Le 2024-01-03 04:32:33 +00:00
parent 657da6b55e
commit 3502245ecb

View File

@ -115,7 +115,9 @@ void listFilesWithRegexpMatchingImpl(
{ {
try try
{ {
fs::path path = fs::canonical(path_for_ls + for_match); /// Do not use fs::canonical or fs::weakly_canonical.
/// Otherwise it will not allow to work with symlinks in `user_files_path` directory.
fs::path path = fs::absolute(path_for_ls + for_match);
result.push_back(path.string()); result.push_back(path.string());
} }
catch (const std::exception &) // NOLINT catch (const std::exception &) // NOLINT