Don't follow symlinks when checking if file exists

This commit is contained in:
Patrick Nicolas committed 2024-12-05 11:18:29 +01:00
1 parent b16e7e1c3d
commit fc3265d2cf
1 file changed
+2 -1
+2 -1
View File
@@ -66,7 +66,8 @@ static std::filesystem::path backup_name(std::filesystem::path file)
static void move_file(const std::filesystem::path & from, const std::filesystem::path & to)
{
if (not std::filesystem::exists(from))
auto from_status = std::filesystem::symlink_status(from);
if (from_status.type() == std::filesystem::file_type::not_found)
return;
std::filesystem::rename(from, to);
}