Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions src/uu/cat/src/platform/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ use windows_sys::Win32::Storage::FileSystem::{
/// An unsafe overwrite occurs when the same file is used as both stdin and stdout
/// and the stdout file is not empty.
pub fn is_unsafe_overwrite<I: AsHandleRef, O: AsHandleRef>(input: &I, output: &O) -> bool {
if !is_same_file_by_path(input, output) {
return false;
}

is_same_file_by_path(input, output) &&
// Check if the output file is empty
FileInformation::from_file(output).is_ok_and(|info| info.file_size() > 0)
}
Expand Down
Loading