mirror of
https://github.com/WiVRn/WiVRn.git
synced 2026-11-21 17:41:54 -08:00
Don't follow symlinks when checking if file exists
This commit is contained in:
1 parent
b16e7e1c3d
commit
fc3265d2cf
1 file changed
+2
-1
@@ -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);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user