Skip to content

Commit

Permalink
Fix panic on commands containing only spaces (#442)
Browse files Browse the repository at this point in the history
* Fix panic on commands containing only spaces

* Add trim
  • Loading branch information
vinc authored Nov 30, 2022
1 parent 6a75ff2 commit 3b51937
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/usr/shell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,11 @@ fn exec_with_config(cmd: &str, config: &mut Config) -> Result<(), ExitCode> {

let cmd = variables_expansion(cmd, config);

let mut args = split_args(&cmd);
let mut args = split_args(&cmd.trim());

if args.is_empty() {
return Ok(());
}

// Replace command alias
if let Some(alias) = config.aliases.get(&args[0]) {
Expand Down

0 comments on commit 3b51937

Please sign in to comment.