scandir() listet kein "." und ".." mehr (Fixt #3?)

This commit is contained in:
Andreas Bielawski 2016-09-12 00:55:53 +02:00
parent 84e5c8d7db
commit 4028a9cea1
2 changed files with 6 additions and 4 deletions

View File

@ -60,4 +60,4 @@ function rpic:action(msg, config)
end
end
return rpic
return rpic

View File

@ -578,8 +578,10 @@ utilities.char = {
function scandir(directory)
local i, t, popen = 0, {}, io.popen
for filename in popen('ls -a "'..directory..'"'):lines() do
i = i + 1
t[i] = filename
if filename ~= "." and filename ~= ".." then
i = i + 1
t[i] = filename
end
end
return t
end
@ -1033,4 +1035,4 @@ function utilities.fix_utf8(str)
end
return utilities
return utilities