Hi, I noticed today that when running "context --jit" that return codes
were not being passed back properly to the shell.
For example, with a simple file like this (text.tex):
\starttext
test\par
\mybadmacro\par
\stoptext
context --jit --nonstopmode test.tex ; echo ", RC=$?"
The log output will print:
mtx-context | fatal error: return code: 1, RC=0
But the shell return code is zero. The below patch fixes it (I'm no Lua
expert so perhaps there is a better approach):
--- a/tex/texmf-context/scripts/context/lua/mtx-context.lua
+++ b/tex/texmf-context/scripts/context/lua/mtx-context.lua
@@ -108,7 +108,7 @@ local function restart(engine_old,engine_new)
local command = format("%s --luaonly %q %s
--redirected",engine_new,environment.ownname,environment.reconstructcommandline())
report(format("redirect %s -> %s:
%s",engine_old,engine_new,command))
local result = os.execute(command)
- os.exit(result)
+ os.exit(result/256)
end
Best regards,
Brian