1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-08-03 14:37:45 +00:00

Fix the build

This commit is contained in:
Steve Klabnik 2015-09-27 23:34:23 -04:00
parent b18a2122ae
commit ac7e289d29
2 changed files with 4 additions and 4 deletions

View file

@ -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| {
out + match ch {
'\t' => 8,
'\x08' => if out > 0 { -1 } else { 0 },
'\x08' => if out > 0 { !0 } else { 0 },
'\r' => return 0,
_ => 1
}

View file

@ -231,7 +231,7 @@ pub fn uumain(args: Vec<String>) -> i32 {
for i in 1 .. args.len()+1 {
match parse_options(&args[1 .. i], &mut options, &opts) {
Ok(OkMsg::Buffering) => {
command_idx = i - 1;
command_idx = (i as i32) - 1;
break;
},
Ok(OkMsg::Help) => {
@ -249,10 +249,10 @@ pub fn uumain(args: Vec<String>) -> i32 {
if command_idx == -1 {
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 (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_O", options.stdout);
set_command_env(&mut command, "_STDBUF_E", options.stderr);