From 4776ca9dd108f65003e55a03ef60e0dd50cae7f1 Mon Sep 17 00:00:00 2001 From: TRAMBO <98341055+baonguyen0703@users.noreply.github.com> Date: Wed, 8 Jun 2022 08:36:49 -0700 Subject: [PATCH] Fix errors when automation scripts being loaded and os.execute not working (#156) * fix errors when automation scripts being loaded and os.execute not working * Update unicode-monkeypatch.lua --- automation/include/unicode-monkeypatch.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/automation/include/unicode-monkeypatch.lua b/automation/include/unicode-monkeypatch.lua index a5d74a8fa..81ca7d5ec 100644 --- a/automation/include/unicode-monkeypatch.lua +++ b/automation/include/unicode-monkeypatch.lua @@ -65,11 +65,11 @@ local function fileresult(stat, fname) return true end - local errno = ffi.errno + local errno = ffi.errno() local msg = ffi.C.strerror(errno) if fname then - return nil, fname .. ": " .. msg, errno + return nil, fname .. ": " .. ffi.string(msg), errno end return nil, msg, errno end @@ -125,7 +125,8 @@ function os.execute(command) local wcommand = command if command then wcommand = widen(command) - return execresult(wcommand) + local stat = ffi.C._wsystem(wcommand) + return execresult(stat) end return true