diff options
author | Ted Trask <ttrask01@yahoo.com> | 2008-09-24 17:43:04 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2008-09-24 17:43:04 +0000 |
commit | c6d537c4ee9e94ff5575d0c112984da0ac895220 (patch) | |
tree | 5706a21e89dff053606971c34bc2f3b876613a73 /lib/fs.lua | |
parent | 42b3d348e8794e9b0754034c7b958d2de62e414a (diff) | |
download | acf-core-c6d537c4ee9e94ff5575d0c112984da0ac895220.tar.bz2 acf-core-c6d537c4ee9e94ff5575d0c112984da0ac895220.tar.xz |
Workaround in fs.lua for exception caused by posix.files when directory doesn't exist.
git-svn-id: svn://svn.alpinelinux.org/acf/core/trunk@1491 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'lib/fs.lua')
-rw-r--r-- | lib/fs.lua | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -117,14 +117,16 @@ function find ( what, where ) where = where or posix.getcwd() f = f or ".*" t = t or {} - for d in posix.files ( where ) do - if fs.is_dir ( where .. "/" .. d ) and (d ~= ".") and ( d ~= "..") then - find_files_as_array (f, where .. "/" .. d, t ) - end - if (string.match (d, "^" .. f .. "$" )) then - table.insert (t, ( string.gsub ( where .. "/" .. d, "/+", "/" ) ) ) + if fs.is_dir(where) then + for d in posix.files ( where ) do + if fs.is_dir ( where .. "/" .. d ) and (d ~= ".") and ( d ~= "..") then + find_files_as_array (f, where .. "/" .. d, t ) + end + if (string.match (d, "^" .. f .. "$" )) then + table.insert (t, ( string.gsub ( where .. "/" .. d, "/+", "/" ) ) ) end end + end return (t) end |