tests: Allow lfs.attributes to be NULL when traversing FS

This commit is contained in:
ZyX
2017-03-12 00:25:55 +03:00
parent 8ef6cfa6ac
commit 9d1b439fb7

View File

@@ -30,6 +30,7 @@ local function glob(initial_path, re, exc_re)
if ((not exc_re or not checked_path:match(exc_re)) if ((not exc_re or not checked_path:match(exc_re))
and e:sub(1, 1) ~= '.') then and e:sub(1, 1) ~= '.') then
local attrs = lfs.attributes(full_path) local attrs = lfs.attributes(full_path)
if attrs then
local check_key = attrs.dev .. ':' .. tostring(attrs.ino) local check_key = attrs.dev .. ':' .. tostring(attrs.ino)
if not checked_files[check_key] then if not checked_files[check_key] then
checked_files[check_key] = true checked_files[check_key] = true
@@ -42,6 +43,7 @@ local function glob(initial_path, re, exc_re)
end end
end end
end end
end
return ret return ret
end end