mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-08-03 22:47:46 +00:00
Fix the build
This commit is contained in:
parent
b18a2122ae
commit
ac7e289d29
2 changed files with 4 additions and 4 deletions
|
@ -156,7 +156,7 @@ fn fold_file<T: Read>(mut file: BufReader<T>, bytes: bool, spaces: bool, width:
|
||||||
let ncount = routput.chars().fold(0, |out, ch: char| {
|
let ncount = routput.chars().fold(0, |out, ch: char| {
|
||||||
out + match ch {
|
out + match ch {
|
||||||
'\t' => 8,
|
'\t' => 8,
|
||||||
'\x08' => if out > 0 { -1 } else { 0 },
|
'\x08' => if out > 0 { !0 } else { 0 },
|
||||||
'\r' => return 0,
|
'\r' => return 0,
|
||||||
_ => 1
|
_ => 1
|
||||||
}
|
}
|
||||||
|
|
|
@ -231,7 +231,7 @@ pub fn uumain(args: Vec<String>) -> i32 {
|
||||||
for i in 1 .. args.len()+1 {
|
for i in 1 .. args.len()+1 {
|
||||||
match parse_options(&args[1 .. i], &mut options, &opts) {
|
match parse_options(&args[1 .. i], &mut options, &opts) {
|
||||||
Ok(OkMsg::Buffering) => {
|
Ok(OkMsg::Buffering) => {
|
||||||
command_idx = i - 1;
|
command_idx = (i as i32) - 1;
|
||||||
break;
|
break;
|
||||||
},
|
},
|
||||||
Ok(OkMsg::Help) => {
|
Ok(OkMsg::Help) => {
|
||||||
|
@ -249,10 +249,10 @@ pub fn uumain(args: Vec<String>) -> i32 {
|
||||||
if command_idx == -1 {
|
if command_idx == -1 {
|
||||||
crash!(125, "Invalid options\nTry 'stdbuf --help' for more information.");
|
crash!(125, "Invalid options\nTry 'stdbuf --help' for more information.");
|
||||||
}
|
}
|
||||||
let ref command_name = args[command_idx];
|
let ref command_name = args[command_idx as usize];
|
||||||
let mut command = Command::new(command_name);
|
let mut command = Command::new(command_name);
|
||||||
let (preload_env, libstdbuf) = get_preload_env();
|
let (preload_env, libstdbuf) = get_preload_env();
|
||||||
command.args(&args[command_idx + 1 ..]).env(preload_env, libstdbuf);
|
command.args(&args[(command_idx as usize)+ 1 ..]).env(preload_env, libstdbuf);
|
||||||
set_command_env(&mut command, "_STDBUF_I", options.stdin);
|
set_command_env(&mut command, "_STDBUF_I", options.stdin);
|
||||||
set_command_env(&mut command, "_STDBUF_O", options.stdout);
|
set_command_env(&mut command, "_STDBUF_O", options.stdout);
|
||||||
set_command_env(&mut command, "_STDBUF_E", options.stderr);
|
set_command_env(&mut command, "_STDBUF_E", options.stderr);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue