cultcache-rs: the POSIX rename passes an absolute destination (FileName without RootDirectory must be a full path)
Some checks failed
CultMesh portability and performance / ubuntu-latest reactive semantics and leases (pull_request) Has been cancelled

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Libby 2026-11-12 22:19:09 +00:00
commit 6094a7dba3

View file

@ -4457,7 +4457,9 @@ impl ReplaceKernel for WindowsKernel {
};
let staged_wide = wide(staged);
let destination_wide = wide(destination);
// FileName with a null RootDirectory must be a full path; MoveFileExW takes a relative one.
let destination_wide =
wide(&std::path::absolute(destination).unwrap_or_else(|_| destination.to_path_buf()));
// FILE_RENAME_INFO ends in a variable-length name: allocate it as u64s for alignment.
let name_bytes = (destination_wide.len() - 1) * 2;
let header = std::mem::size_of::<FILE_RENAME_INFO>();