cat: add WASI stub for is_unsafe_overwrite and add to feat_wasm

WASI has no fstat-based device/inode checks, so always return false
(assume safe) for the overwrite detection.
This commit is contained in:
Sylvestre Ledru
2026-03-30 20:42:26 +02:00
committed by Daniel Hofstetter
parent f0c23247ba
commit e510449dce
2 changed files with 7 additions and 0 deletions
+1
View File
@@ -184,6 +184,7 @@ feat_wasm = [
"base32",
"base64",
"basenc",
"cat",
"cut",
"ls",
"date",
+6
View File
@@ -9,6 +9,12 @@ pub use self::unix::is_unsafe_overwrite;
#[cfg(windows)]
pub use self::windows::is_unsafe_overwrite;
// WASI: no fstat-based device/inode checks available; assume safe.
#[cfg(target_os = "wasi")]
pub fn is_unsafe_overwrite<I, O>(_input: &I, _output: &O) -> bool {
false
}
#[cfg(unix)]
mod unix;