From 42700461123bf4c8deeb107dad79cb5f26b229b4 Mon Sep 17 00:00:00 2001 From: Ryuichi Ueda Date: Tue, 23 Jan 2024 12:44:41 +0900 Subject: [PATCH] Change the order for bug fix --- src/elements/command/simple.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/elements/command/simple.rs b/src/elements/command/simple.rs index 62960974..3e79a7dd 100644 --- a/src/elements/command/simple.rs +++ b/src/elements/command/simple.rs @@ -30,14 +30,14 @@ pub struct SimpleCommand { impl Command for SimpleCommand { fn exec(&mut self, core: &mut ShellCore, pipe: &mut Pipe) -> Option { - if self.words.len() == 0 { - return None; - } - self.args = self.words.iter() .filter(|w| w.text != "") .map(|w| w.text.clone()).collect(); + if self.args.len() == 0 { + return None; + } + if self.force_fork || pipe.is_connected() || ! core.builtins.contains_key(&self.args[0]) {