mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-27 19:17:43 +00:00
Moved code officially to run on nightly since it's a dependency
This commit is contained in:
parent
239443a253
commit
f8df842dfb
9 changed files with 7 additions and 15 deletions
2
Makefile
2
Makefile
|
@ -320,7 +320,7 @@ $(BUILDDIR)/uutils: $(SRCDIR)/uutils/uutils.rs $(BUILDDIR)/mkuutils $(RLIB_PATHS
|
||||||
# Library for stdbuf
|
# Library for stdbuf
|
||||||
$(BUILDDIR)/libstdbuf.$(DYLIB_EXT): $(SRCDIR)/stdbuf/libstdbuf.rs $(SRCDIR)/stdbuf/libstdbuf.c $(SRCDIR)/stdbuf/libstdbuf.h | $(BUILDDIR)
|
$(BUILDDIR)/libstdbuf.$(DYLIB_EXT): $(SRCDIR)/stdbuf/libstdbuf.rs $(SRCDIR)/stdbuf/libstdbuf.c $(SRCDIR)/stdbuf/libstdbuf.h | $(BUILDDIR)
|
||||||
cd $(SRCDIR)/stdbuf && \
|
cd $(SRCDIR)/stdbuf && \
|
||||||
$(RUSTC) libstdbuf.rs && \
|
$(RUSTC) libstdbuf.rs --extern libc=$(BUILDDIR)/liblibc.rlib && \
|
||||||
$(CC) -c -Wall -Werror -fPIC libstdbuf.c && \
|
$(CC) -c -Wall -Werror -fPIC libstdbuf.c && \
|
||||||
$(CC) $(DYLIB_FLAGS) -o libstdbuf.$(DYLIB_EXT) liblibstdbuf.a libstdbuf.o && \
|
$(CC) $(DYLIB_FLAGS) -o libstdbuf.$(DYLIB_EXT) liblibstdbuf.a libstdbuf.o && \
|
||||||
mv *.$(DYLIB_EXT) $(BUILDDIR) && $(RM) *.o && $(RM) *.a
|
mv *.$(DYLIB_EXT) $(BUILDDIR) && $(RM) *.o && $(RM) *.a
|
||||||
|
|
|
@ -174,8 +174,7 @@ pub fn uumain(args: Vec<String>) -> i32 {
|
||||||
};
|
};
|
||||||
|
|
||||||
if !free.is_empty() {
|
if !free.is_empty() {
|
||||||
// NB: Using deprecated connect() until Rust 1.3 becomes stable.
|
let string = free.join(" ");
|
||||||
let string = free.connect(" ");
|
|
||||||
if options.escape {
|
if options.escape {
|
||||||
let mut prev_was_slash = false;
|
let mut prev_was_slash = false;
|
||||||
let mut iter = string.chars().enumerate();
|
let mut iter = string.chars().enumerate();
|
||||||
|
|
|
@ -153,7 +153,7 @@ fn fold_file<T: Read>(mut file: BufReader<T>, bytes: bool, spaces: bool, width:
|
||||||
match rfind_whitespace(slice) {
|
match rfind_whitespace(slice) {
|
||||||
Some(m) => {
|
Some(m) => {
|
||||||
let routput = &slice[m + 1 .. slice.chars().count()];
|
let routput = &slice[m + 1 .. slice.chars().count()];
|
||||||
let ncount = routput.chars().fold(0usize, |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 { -1 } else { 0 },
|
||||||
|
|
|
@ -420,9 +420,7 @@ fn adjust_tex_str(context: &str) -> String {
|
||||||
let ws_reg = Regex::new(r"[\t\n\v\f\r ]").unwrap();
|
let ws_reg = Regex::new(r"[\t\n\v\f\r ]").unwrap();
|
||||||
let mut fix: String = ws_reg.replace_all(context, " ").trim().to_string();
|
let mut fix: String = ws_reg.replace_all(context, " ").trim().to_string();
|
||||||
let mapped_chunks: Vec<String> = fix.chars().map(tex_mapper).collect();
|
let mapped_chunks: Vec<String> = fix.chars().map(tex_mapper).collect();
|
||||||
// NB: Using deprecated connect() until Rust 1.3 becomes stable.
|
fix = mapped_chunks.join("");
|
||||||
// When 1.3 is released, replace connect() with join().
|
|
||||||
fix = mapped_chunks.connect("");
|
|
||||||
fix
|
fix
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#![crate_name = "libstdbuf"]
|
#![crate_name = "libstdbuf"]
|
||||||
#![crate_type = "staticlib"]
|
#![crate_type = "staticlib"]
|
||||||
#![feature(libc)]
|
|
||||||
|
|
||||||
extern crate libc;
|
extern crate libc;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
#![crate_name = "stdbuf"]
|
#![crate_name = "stdbuf"]
|
||||||
#![feature(negate_unsigned)]
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This file is part of the uutils coreutils package.
|
* This file is part of the uutils coreutils package.
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
#![crate_name = "timeout"]
|
#![crate_name = "timeout"]
|
||||||
#![feature(process_id)]
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This file is part of the uutils coreutils package.
|
* This file is part of the uutils coreutils package.
|
||||||
|
|
|
@ -117,7 +117,6 @@ fn exec(filename: &str) {
|
||||||
|
|
||||||
if users.len() > 0 {
|
if users.len() > 0 {
|
||||||
users.sort();
|
users.sort();
|
||||||
// NB: Using deprecated connect() until Rust 1.3 becomes stable.
|
println!("{}", users.join(" "));
|
||||||
println!("{}", users.connect(" "));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,8 +50,7 @@ pub fn uumain(args: Vec<String>) -> i32 {
|
||||||
let string = if matches.free.is_empty() {
|
let string = if matches.free.is_empty() {
|
||||||
"y".to_string()
|
"y".to_string()
|
||||||
} else {
|
} else {
|
||||||
// NB: Using deprecated connect() until Rust 1.3 becomes stable.
|
matches.free.join(" ")
|
||||||
matches.free.connect(" ")
|
|
||||||
};
|
};
|
||||||
|
|
||||||
exec(&string[..]);
|
exec(&string[..]);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue