summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2009-01-30 13:55:23 +0000
committerTed Trask <ttrask01@yahoo.com>2009-01-30 13:55:23 +0000
commit14edfeda8988f8de7dd5d236130ec9e0418a7cab (patch)
tree953a90cfed4517b9cc05845d2c12a37399f70412
parent4b52fd134e00f67be26b9ad2e668be4eebed9fd5 (diff)
downloadacf-core-14edfeda8988f8de7dd5d236130ec9e0418a7cab.tar.bz2
acf-core-14edfeda8988f8de7dd5d236130ec9e0418a7cab.tar.xz
Fixed bug in fs.find_files_as_array.
git-svn-id: svn://svn.alpinelinux.org/acf/core/trunk@1698 ab2d0c66-481e-0410-8bed-d214d4d58bed
-rw-r--r--lib/fs.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/fs.lua b/lib/fs.lua
index 15ce442..63991d4 100644
--- a/lib/fs.lua
+++ b/lib/fs.lua
@@ -154,10 +154,11 @@ function find_files_as_array ( what, where, t )
t = t or {}
if fs.is_dir(where) then
for d in posix.files ( where ) do
- if fs.is_dir ( where .. "/" .. d ) and (d ~= ".") and ( d ~= "..") then
+ if (d == ".") or ( d == "..") then
+ -- do nothing
+ elseif fs.is_dir ( where .. "/" .. d ) then
find_files_as_array (what, where .. "/" .. d, t )
- end
- if (string.match (d, "^" .. what .. "$" )) then
+ elseif (string.match (d, "^" .. what .. "$" )) then
table.insert (t, ( string.gsub ( where .. "/" .. d, "/+", "/" ) ) )
end
end