From 982798cae60e1e213d3246fbdf193b4ffc50a9e3 Mon Sep 17 00:00:00 2001
From: Michael Aaron Murphy <mmstickman@gmail.com>
Date: Fri, 1 Dec 2017 00:57:23 -0500
Subject: [PATCH] Revert "Fix "and/or followed by let results in command not
 found issue" (#620)"

This reverts commit daab4fb0c49d3b39a6e34532253a21698a86a3a2.
---
 src/builtins/mod.rs | 21 ++++-----------------
 1 file changed, 4 insertions(+), 17 deletions(-)

diff --git a/src/builtins/mod.rs b/src/builtins/mod.rs
index c3948ce0..32e74ae5 100644
--- a/src/builtins/mod.rs
+++ b/src/builtins/mod.rs
@@ -440,25 +440,11 @@ fn builtin_not(args: &[&str], shell: &mut Shell) -> i32 {
     }
 }
 
-fn custom_eval(args: &[&str], shell: &mut Shell, un_terminated: &str) -> i32 {
-    let evaluated_command = args[1..].join(" ");
-    let mut buffer = Terminator::new(evaluated_command);
-
-    if buffer.is_terminated() {
-        shell.on_command(&buffer.consume());
-        shell.previous_status
-    } else {
-        let stderr = io::stderr();
-        let mut stderr = stderr.lock();
-        let _ = writeln!(stderr, "{}", un_terminated);
-        FAILURE
-    }
-}
-
 fn builtin_and(args: &[&str], shell: &mut Shell) -> i32 {
     match shell.previous_status {
         SUCCESS => {
-            custom_eval(args, shell, "ion: supplied expression after 'and' was not terminated")
+            shell.run_pipeline(&mut args_to_pipeline(&args[1..]));
+            shell.previous_status
         }
         _ => shell.previous_status,
     }
@@ -467,7 +453,8 @@ fn builtin_and(args: &[&str], shell: &mut Shell) -> i32 {
 fn builtin_or(args: &[&str], shell: &mut Shell) -> i32 {
     match shell.previous_status {
         FAILURE => {
-            custom_eval(args, shell, "ion: supplied expression after 'and' was not terminated")
+            shell.run_pipeline(&mut args_to_pipeline(&args[1..]));
+            shell.previous_status
         }
         _ => shell.previous_status,
     }
-- 
GitLab