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:
parent
e5dee3fbe2
commit
4776ca9dd1
1 changed files with 4 additions and 3 deletions
|
@ -65,11 +65,11 @@ local function fileresult(stat, fname)
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
local errno = ffi.errno
|
local errno = ffi.errno()
|
||||||
local msg = ffi.C.strerror(errno)
|
local msg = ffi.C.strerror(errno)
|
||||||
|
|
||||||
if fname then
|
if fname then
|
||||||
return nil, fname .. ": " .. msg, errno
|
return nil, fname .. ": " .. ffi.string(msg), errno
|
||||||
end
|
end
|
||||||
return nil, msg, errno
|
return nil, msg, errno
|
||||||
end
|
end
|
||||||
|
@ -125,7 +125,8 @@ function os.execute(command)
|
||||||
local wcommand = command
|
local wcommand = command
|
||||||
if command then
|
if command then
|
||||||
wcommand = widen(command)
|
wcommand = widen(command)
|
||||||
return execresult(wcommand)
|
local stat = ffi.C._wsystem(wcommand)
|
||||||
|
return execresult(stat)
|
||||||
end
|
end
|
||||||
|
|
||||||
return true
|
return true
|
||||||
|
|
Loading…
Reference in a new issue