From ee341369a1f3bb113e051154ddd3a9d78f5e30f6 Mon Sep 17 00:00:00 2001 From: Jordi Vilalta Prat Date: Mon, 25 Apr 2016 15:46:58 +0200 Subject: Fix the return code of os.execute() on Windows. --- compat53/module.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'compat53/module.lua') diff --git a/compat53/module.lua b/compat53/module.lua index c4fc515..dad940b 100644 --- a/compat53/module.lua +++ b/compat53/module.lua @@ -601,7 +601,10 @@ if lua_version < "5.3" then if code == 0 then return true, "exit", code else - return nil, "exit", code/256 -- only correct on Linux! + if package.config:sub(1, 1) == '/' then + code = code/256 -- only correct on Linux! + end + return nil, "exit", code end end end -- cgit v1.2.3-55-g6feb