diff --git a/Cargo.lock b/Cargo.lock index e48eae42f6c9d397932be535495a6f6770cf61f0..746621d68f0bc122a91799217c048c9073cb4e3f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -823,7 +823,7 @@ dependencies = [ [[package]] name = "redoxer" -version = "0.2.18" +version = "0.2.19" dependencies = [ "dirs 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "proc-mounts 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/Cargo.toml b/Cargo.toml index 46303b00f67a57f4a69a7437f7d1be06a871d4fa..3e223b3cd28d5c64391f963d7e34cd11ef686ddf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "redoxer" -version = "0.2.18" +version = "0.2.19" description = "Method for quickly running programs inside of Redox from a KVM capable OS." license = "MIT" authors = ["Jeremy Soller <jackpot51@gmail.com>"] diff --git a/src/env.rs b/src/env.rs index 2a6f0dde4a385a2b55801002907b310cbe403ab1..5895edc98fd7a2e82fdc9f79b6f705b5fb22465a 100644 --- a/src/env.rs +++ b/src/env.rs @@ -35,20 +35,8 @@ pub fn command<S: AsRef<ffi::OsStr>>(program: S) -> io::Result<process::Command> } fn inner<I: Iterator<Item=String>>(args: I) -> io::Result<()> { - let mut program_opt = None; - let mut arguments = Vec::new(); - for arg in args.skip(2) { - if program_opt.is_none() { - program_opt = Some(arg); - } else { - arguments.push(arg); - } - } - - //TODO: get user's default shell? - let program = program_opt.unwrap_or("bash".to_string()); - command(program)? - .args(arguments) + command("env")? + .args(args) .status() .and_then(status_error)?; @@ -56,7 +44,7 @@ fn inner<I: Iterator<Item=String>>(args: I) -> io::Result<()> { } pub fn main(args: &[String]) { - match inner(args.iter().cloned()) { + match inner(args.iter().cloned().skip(2)) { Ok(()) => { process::exit(0); },