mirror of
https://github.com/uutils/coreutils
synced 2024-12-17 08:33:24 +00:00
Merge pull request #436 from ebfe/fix-build-master
Partially fix build with rust master
This commit is contained in:
commit
b25c01f0f5
6 changed files with 8 additions and 9 deletions
|
@ -68,7 +68,7 @@ impl Range {
|
||||||
|
|
||||||
while j < ranges.len() && ranges[j].low <= ranges[i].high {
|
while j < ranges.len() && ranges[j].low <= ranges[i].high {
|
||||||
let j_high = ranges.remove(j).unwrap().high;
|
let j_high = ranges.remove(j).unwrap().high;
|
||||||
ranges.get_mut(i).high = max(ranges[i].high, j_high);
|
ranges[i].high = max(ranges[i].high, j_high);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -229,7 +229,7 @@ fn find_kp_breakpoints<'a, T: Iterator<&'a WordInfo<'a>>>(iter: T, args: &BreakA
|
||||||
// go through each active break, extending it and possibly adding a new active
|
// go through each active break, extending it and possibly adding a new active
|
||||||
// break if we are above the minimum required length
|
// break if we are above the minimum required length
|
||||||
for &i in active_breaks.iter() {
|
for &i in active_breaks.iter() {
|
||||||
let active = linebreaks.get_mut(i);
|
let active = &mut linebreaks[i];
|
||||||
// normalize demerits to avoid overflow, and record if this is the least
|
// normalize demerits to avoid overflow, and record if this is the least
|
||||||
active.demerits -= least_demerits;
|
active.demerits -= least_demerits;
|
||||||
if active.demerits < ld_next {
|
if active.demerits < ld_next {
|
||||||
|
|
|
@ -16,7 +16,7 @@ extern crate getopts;
|
||||||
|
|
||||||
use std::char;
|
use std::char;
|
||||||
use std::io::{stdin};
|
use std::io::{stdin};
|
||||||
use std::io::BufferedReader;
|
use std::io::{BufferedReader, BytesReader};
|
||||||
use std::io::fs::File;
|
use std::io::fs::File;
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
use std::str::from_utf8;
|
use std::str::from_utf8;
|
||||||
|
|
|
@ -99,7 +99,7 @@ fn paste(filenames: Vec<String>, serial: bool, delimiters: &str) {
|
||||||
match file.read_line() {
|
match file.read_line() {
|
||||||
Ok(line) => output.push_str(line.as_slice().slice_to(line.len() - 1)),
|
Ok(line) => output.push_str(line.as_slice().slice_to(line.len() - 1)),
|
||||||
Err(f) => if f.kind == io::EndOfFile {
|
Err(f) => if f.kind == io::EndOfFile {
|
||||||
*eof.get_mut(i) = true;
|
eof[i] = true;
|
||||||
eof_count += 1;
|
eof_count += 1;
|
||||||
} else {
|
} else {
|
||||||
crash!(1, "{}", f.to_string());
|
crash!(1, "{}", f.to_string());
|
||||||
|
|
|
@ -15,12 +15,11 @@ extern crate getopts;
|
||||||
|
|
||||||
use std::char;
|
use std::char;
|
||||||
use std::io::{stdin};
|
use std::io::{stdin};
|
||||||
use std::io::BufferedReader;
|
use std::io::{BufferedReader, BytesReader};
|
||||||
use std::io::fs::File;
|
use std::io::fs::File;
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
use std::str::from_utf8;
|
use std::str::from_utf8;
|
||||||
use getopts::{optopt, optflag, getopts, usage};
|
use getopts::{optopt, optflag, getopts, usage};
|
||||||
use std::collections::Deque;
|
|
||||||
use std::collections::ringbuf::RingBuf;
|
use std::collections::ringbuf::RingBuf;
|
||||||
use std::io::timer::sleep;
|
use std::io::timer::sleep;
|
||||||
use std::time::duration::Duration;
|
use std::time::duration::Duration;
|
||||||
|
|
|
@ -46,7 +46,7 @@ fn main() {
|
||||||
let binary = Path::new(args[0].as_slice());
|
let binary = Path::new(args[0].as_slice());
|
||||||
let binary_as_util = binary.filename_str().unwrap();
|
let binary_as_util = binary.filename_str().unwrap();
|
||||||
|
|
||||||
match umap.find_equiv(&binary_as_util) {
|
match umap.find_equiv(binary_as_util) {
|
||||||
Some(&uumain) => {
|
Some(&uumain) => {
|
||||||
os::set_exit_status(uumain(args));
|
os::set_exit_status(uumain(args));
|
||||||
return
|
return
|
||||||
|
@ -70,7 +70,7 @@ fn main() {
|
||||||
args.remove(0);
|
args.remove(0);
|
||||||
let util = args[0].as_slice();
|
let util = args[0].as_slice();
|
||||||
|
|
||||||
match umap.find_equiv(&util) {
|
match umap.find_equiv(util) {
|
||||||
Some(&uumain) => {
|
Some(&uumain) => {
|
||||||
os::set_exit_status(uumain(args.clone()));
|
os::set_exit_status(uumain(args.clone()));
|
||||||
return
|
return
|
||||||
|
@ -80,7 +80,7 @@ fn main() {
|
||||||
// see if they want help on a specific util
|
// see if they want help on a specific util
|
||||||
if args.len() >= 2 {
|
if args.len() >= 2 {
|
||||||
let util = args[1].as_slice();
|
let util = args[1].as_slice();
|
||||||
match umap.find_equiv(&util) {
|
match umap.find_equiv(util) {
|
||||||
Some(&uumain) => {
|
Some(&uumain) => {
|
||||||
os::set_exit_status(uumain(vec![util.to_string(), "--help".to_string()]));
|
os::set_exit_status(uumain(vec![util.to_string(), "--help".to_string()]));
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue