1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

Update basename for latest rustc

This commit is contained in:
Jordi Boggiano 2014-01-07 01:54:02 +01:00
parent c50e475c6b
commit aa889f6bae
2 changed files with 5 additions and 5 deletions

View file

@ -9,6 +9,7 @@ RMFLAGS :=
# Possible programs # Possible programs
PROGS := \ PROGS := \
base64 \ base64 \
basename \
cat \ cat \
dirname \ dirname \
echo \ echo \
@ -24,7 +25,6 @@ PROGS := \
wc \ wc \
whoami \ whoami \
yes \ yes \
basename \
BUILD ?= $(PROGS) BUILD ?= $(PROGS)

View file

@ -1,4 +1,4 @@
#[link(name="basename", vers="1.0.0", author="Jimmy Lu")]; #[crate_id(name="basename", vers="1.0.0", author="Jimmy Lu")];
/* /*
* This file is part of the uutils coreutils package. * This file is part of the uutils coreutils package.
@ -36,8 +36,8 @@ fn main() {
let matches = match groups::getopts(args.tail(), opts) { let matches = match groups::getopts(args.tail(), opts) {
Ok(m) => m, Ok(m) => m,
Err(f) => { Err(f) => {
let stderr = stderr(); writeln!(&mut stderr() as &mut Writer,
stderr.write_str(program + ": " + f.to_err_msg() + "\n"); "Invalid options\n{}", f.to_err_msg());
os::set_exit_status(1); os::set_exit_status(1);
return; return;
} }
@ -91,7 +91,7 @@ fn main() {
fn strip_dir(fullname :&~str) -> ~str { fn strip_dir(fullname :&~str) -> ~str {
let mut name = ~""; let mut name = ~"";
for c in fullname.rev_iter() { for c in fullname.chars_rev() {
if c == '/' || c == '\\' { if c == '/' || c == '\\' {
return name; return name;
} }