Skip to content

Commit e793b70

Browse files
committed
some linting
1 parent 3c78bfe commit e793b70

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

sh.lua

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,14 @@ function Stack:Create()
3232

3333
-- pop a value from the stack
3434
function t:pop(num)
35-
3635
-- get num values from stack
37-
local num = num or 1
36+
num = num or 1
3837

3938
-- return table
4039
local entries = {}
4140

4241
-- get values into entries
43-
for i = 1, num do
42+
for _ = 1, num do
4443
-- get last entry
4544
if #self._et ~= 0 then
4645
table.insert(entries, self._et[#self._et])
@@ -83,7 +82,7 @@ local function popen3(path, ...)
8382

8483
assert((r1 ~= nil or r2 ~= nil or r3 ~= nil), "pipe() failed")
8584

86-
local pid, err = posix.fork()
85+
local pid, _ = posix.fork()
8786
assert(pid ~= nil, "fork() failed")
8887
if pid == 0 then
8988
posix.close(w1)
@@ -96,7 +95,7 @@ local function popen3(path, ...)
9695
posix.close(w2)
9796
posix.close(w3)
9897

99-
local ret, err, errno = posix.execp(path, table.unpack({...}))
98+
local ret, _, _ = posix.execp(path, table.unpack({...}))
10099
assert(ret ~= nil, "execp() failed")
101100

102101
posix._exit(1)
@@ -171,7 +170,7 @@ local function pipe_simple(input, cmd, ...)
171170
local read_stderr = coroutine.create(function () read_async(e, bufsize, timeout) end)
172171
while true do
173172
if not stdout_ended then
174-
local cstatus, pstatus, ended, buf, pcode = coroutine.resume(read_stdout)
173+
local _, pstatus, ended, buf, _ = coroutine.resume(read_stdout)
175174
if pstatus == 1 then
176175
stdout_ended = ended
177176
if not stdout_ended then
@@ -181,7 +180,7 @@ local function pipe_simple(input, cmd, ...)
181180
end
182181

183182
if not stderr_ended then
184-
local cstatus, pstatus, ended, buf, pcode = coroutine.resume(read_stderr)
183+
local _, pstatus, ended, buf, _ = coroutine.resume(read_stderr)
185184
if pstatus == 1 then
186185
stderr_ended = ended
187186
if not stderr_ended then

0 commit comments

Comments
 (0)