From 4080ba90e95cef5805e48d24b46dc1121155aea2 Mon Sep 17 00:00:00 2001 From: TorchedSammy <38820196+TorchedSammy@users.noreply.github.com> Date: Thu, 21 Apr 2022 23:41:49 -0400 Subject: [PATCH] fix: correct custom runner mode handling with recent changes --- exec.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/exec.go b/exec.go index 90498ab..fcedf62 100644 --- a/exec.go +++ b/exec.go @@ -73,7 +73,7 @@ func runInput(input string, priv bool) { } } else { // can only be a string or function so - term := rt.NewTerminationWith(l.MainThread().CurrentCont(), 2, false) + term := rt.NewTerminationWith(l.MainThread().CurrentCont(), 3, false) err := rt.Call(l.MainThread(), runnerMode, []rt.Value{rt.StringValue(cmdString)}, term) if err != nil { fmt.Fprintln(os.Stderr, err) @@ -81,9 +81,9 @@ func runInput(input string, priv bool) { return } - luaexitcode := term.Get(0) - runErr := term.Get(1) - luaInput := term.Get(1) + luaInput := term.Get(0) + luaexitcode := term.Get(1) + runErr := term.Get(2) var exitCode uint8 if code, ok := luaexitcode.TryInt(); ok {