mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-29 12:07:46 +00:00
Modified code to replace all instances of -
Now all instances of `-` will be replaced with real / canonicalized path of `/dev/stdin`
This commit is contained in:
parent
71a6ae1443
commit
193899f09c
1 changed files with 9 additions and 3 deletions
|
@ -477,11 +477,17 @@ impl Stater {
|
|||
.unwrap_or_default();
|
||||
#[cfg(unix)]
|
||||
if files.contains(&String::from("-")) {
|
||||
files = Vec::from([Path::new("/dev/stdin")
|
||||
.canonicalize()?
|
||||
let redirected_path = Path::new("/dev/stdin")
|
||||
.canonicalize()
|
||||
.expect("unable to canonicalize /dev/stdin")
|
||||
.into_os_string()
|
||||
.into_string()
|
||||
.unwrap()]);
|
||||
.unwrap();
|
||||
for file in &mut files {
|
||||
if file == "-" {
|
||||
*file = redirected_path.clone();
|
||||
}
|
||||
}
|
||||
}
|
||||
let format_str = if matches.is_present(options::PRINTF) {
|
||||
matches
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue