diff options
author | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2019-05-26 10:47:51 -0400 |
---|---|---|
committer | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2019-05-26 10:47:51 -0400 |
commit | 3cade65ddfc06965c366ba829b123c4b7b7fd7f7 (patch) | |
tree | f519765d156d9b3baf877122a03c095320c8ec4d /src/commands/mod.rs | |
parent | d36f7d17c116c2b7738af758c84fa19481c62249 (diff) |
prevent command substitution when reading config
Diffstat (limited to 'src/commands/mod.rs')
-rw-r--r-- | src/commands/mod.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/commands/mod.rs b/src/commands/mod.rs index d4cbfb0..8cea62a 100644 --- a/src/commands/mod.rs +++ b/src/commands/mod.rs @@ -86,7 +86,7 @@ pub fn from_args(command: &str, args: &str) -> Result<Box<JoshutoCommand>, Keyma )), }, ".." => Ok(Box::new(self::ParentDirectory::new())), - args => match wordexp::wordexp(args, wordexp::Wordexp::new(0), 0) { + args => match wordexp::wordexp(args, wordexp::Wordexp::new(0), wordexp::WRDE_NOCMD) { Ok(mut exp_strs) => match exp_strs.next() { Some(exp_str) => { Ok(Box::new(self::ChangeDirectory::new(PathBuf::from(exp_str)))) @@ -134,7 +134,7 @@ pub fn from_args(command: &str, args: &str) -> Result<Box<JoshutoCommand>, Keyma Some("mkdir"), String::from("mkdir requires additional parameter"), )), - args => match wordexp::wordexp(args, wordexp::Wordexp::new(0), 0) { + args => match wordexp::wordexp(args, wordexp::Wordexp::new(0), wordexp::WRDE_NOCMD) { Ok(mut exp_strs) => match exp_strs.next() { Some(exp_str) => Ok(Box::new(self::NewDirectory::new(PathBuf::from(exp_str)))), None => Err(KeymapError::new( |