diff options
author | Ted Trask <ttrask01@yahoo.com> | 2009-01-30 13:55:23 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2009-01-30 13:55:23 +0000 |
commit | 14edfeda8988f8de7dd5d236130ec9e0418a7cab (patch) | |
tree | 953a90cfed4517b9cc05845d2c12a37399f70412 /lib | |
parent | 4b52fd134e00f67be26b9ad2e668be4eebed9fd5 (diff) | |
download | acf-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
Diffstat (limited to 'lib')
-rw-r--r-- | lib/fs.lua | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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 |