1
0
Fork 0

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
This commit is contained in:
TRAMBO 2022-06-08 08:36:49 -07:00 committed by GitHub
parent e5dee3fbe2
commit 4776ca9dd1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -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