From c6964ceb04e7dbae8bedf2ca47cf8686514156d4 Mon Sep 17 00:00:00 2001 From: HAYAMA_Kaoru Date: Thu, 9 Oct 2014 09:56:04 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=91=E3=82=A4=E3=83=97=E3=83=A9=E3=82=A4?= =?UTF-8?q?=E3=83=B3=E3=81=8C=E5=8B=95=E4=BD=9C=E3=81=97=E3=81=AA=E3=81=8F?= =?UTF-8?q?=E3=81=AA=E3=81=A3=E3=81=A6=E3=81=84=E3=81=9F=E4=B8=8D=E5=85=B7?= =?UTF-8?q?=E5=90=88=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- interpreter/interpreter.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/interpreter/interpreter.go b/interpreter/interpreter.go index 16ad9b77..dee95731 100644 --- a/interpreter/interpreter.go +++ b/interpreter/interpreter.go @@ -30,6 +30,7 @@ func (this *Interpreter) Clone() *Interpreter { rv.Stderr = this.Stderr rv.Stdin = this.Stdin rv.HookCount = this.HookCount + // Dont Copy 'Closer' and 'IsBackGround' return this } @@ -63,8 +64,8 @@ func (this *Interpreter) Interpret(text string) (NextT, error) { for _, pipeline := range statements { var pipeIn *os.File = nil for _, state := range pipeline { - //fmt.Println(state) - cmd := this.Clone() + var cmd Interpreter + cmd.HookCount = this.HookCount if this.Stderr != nil { cmd.Stdin = this.Stdin } else { @@ -141,7 +142,7 @@ func (this *Interpreter) Interpret(text string) (NextT, error) { cmd.Args = state.Argv cmd.IsBackGround = isBackGround cmd.Closer = pipeOut - whatToDo, err = hook(cmd) + whatToDo, err = hook(&cmd) if whatToDo == THROUGH { cmd.Path, err = exec.LookPath(state.Argv[0]) if err == nil {