From b9eb364823d0d4f9085eb220233c704a13d0f611 Mon Sep 17 00:00:00 2001 From: Jan Beich Date: Sun, 13 Dec 2015 19:47:17 +0000 Subject: [PATCH 1/3] Fix getting tty window size on more BSDs src/term.rs:37:39: 37:49 error: unresolved name `TIOCGWINSZ` [E0425] src/term.rs:37 let result = ioctl(STDOUT_FILENO, TIOCGWINSZ, &mut window); ^~~~~~~~~~ --- src/term.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/term.rs b/src/term.rs index 87ea242..4f0e000 100644 --- a/src/term.rs +++ b/src/term.rs @@ -22,7 +22,13 @@ struct Winsize { #[cfg(any(target_os = "linux", target_os = "android"))] static TIOCGWINSZ: c_ulong = 0x5413; -#[cfg(any(target_os = "macos", target_os = "ios", target_os = "dragonfly"))] +#[cfg(any(target_os = "macos", + target_os = "ios", + target_os = "bitrig", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd"))] static TIOCGWINSZ: c_ulong = 0x40087468; extern { From b35927f24779a4d2ea9212c3c3000daf50027d63 Mon Sep 17 00:00:00 2001 From: Jan Beich Date: Sun, 13 Dec 2015 22:58:22 +0000 Subject: [PATCH 2/3] Fix logic inversion with --git in --help $ exa --help [...] -@, --extended display extended attribute keys and sizes $ exa -@ Unrecognized option: '@'. $ exa --extended Unrecognized option: 'extended'. $ exa --git Option --git is useless without option --long. $ exa -l --git .rw-r--r-- 11k user 10 Dec 18:26 -- Cargo.lock [...] --- src/options.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/options.rs b/src/options.rs index 72996bc..adffef1 100644 --- a/src/options.rs +++ b/src/options.rs @@ -727,9 +727,8 @@ LONG VIEW OPTIONS -U, --created display timestamp of creation for a file "##; -static GIT_HELP: &'static str = r##" -@, --extended display extended attribute keys and sizes"##; -static EXTENDED_HELP: &'static str = r##" --git show git status for files"##; - +static GIT_HELP: &'static str = r##" --git show git status for files"##; +static EXTENDED_HELP: &'static str = r##" -@, --extended display extended attribute keys and sizes"##; #[cfg(test)] mod test { From 92328d9093fe2d62822f56149b9ff9c8fa097959 Mon Sep 17 00:00:00 2001 From: Jan Beich Date: Mon, 14 Dec 2015 03:13:40 +0000 Subject: [PATCH 3/3] Move CString to where it's actually used src/feature/xattr.rs:6:5: 6:22 warning: unused import, #[warn(unused_imports)] on by default src/feature/xattr.rs:6 use std::ffi::CString; ^~~~~~~~~~~~~~~~~ --- src/feature/xattr.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/feature/xattr.rs b/src/feature/xattr.rs index 8682087..c705d1d 100644 --- a/src/feature/xattr.rs +++ b/src/feature/xattr.rs @@ -3,7 +3,6 @@ extern crate libc; use std::io; use std::path::Path; -use std::ffi::CString; pub const ENABLED: bool = cfg!(feature="git") && cfg!(any(target_os="macos", target_os="linux")); @@ -51,6 +50,8 @@ pub struct Attribute { #[cfg(any(target_os = "macos", target_os = "linux"))] pub fn list_attrs(lister: lister::Lister, path: &Path) -> io::Result> { + use std::ffi::CString; + let c_path = match path.to_str().and_then(|s| { CString::new(s).ok() }) { Some(cstring) => cstring, None => return Err(io::Error::new(io::ErrorKind::Other, "Error: path somehow contained a NUL?")),