$ find ~ -print0 | ./target/debug/xargs -0 echo >/dev/null
Error: Command could not be run: Argument list too long (os error 7)
From a quick look, there's at least an issue here:
|
#[cfg(unix)] |
|
fn count_osstr_chars_for_exec(s: &OsStr) -> usize { |
|
use std::os::unix::ffi::OsStrExt; |
|
// Include +1 for the null terminator. |
|
s.as_bytes().len() + 1 |
|
} |
This needs to count not only the length of the string, but also the size of the pointer that ends up in argv/envp.
It might be worth using the https://crates.io/crates/argmax crate to do this accounting for us. It could also help for #6.
From a quick look, there's at least an issue here:
findutils/src/xargs/mod.rs
Lines 141 to 146 in 36e3229
This needs to count not only the length of the string, but also the size of the pointer that ends up in
argv/envp.It might be worth using the https://crates.io/crates/argmax crate to do this accounting for us. It could also help for #6.