diff options
author | Marius <mariausol@gmail.com> | 2011-02-04 01:40:12 +0200 |
---|---|---|
committer | Marius <mariausol@gmail.com> | 2011-02-04 01:40:12 +0200 |
commit | 9f01e839943b3edf71e6272d9d9e40d9cb74d2ee (patch) | |
tree | 3d6937e032ebda2b57a9d983bc56029af65dd703 /tex/context/base/l-dir.lua | |
parent | 9cad29f0d0ae5b3e2d4eb31218ad9f6c83d40b9f (diff) | |
download | context-9f01e839943b3edf71e6272d9d9e40d9cb74d2ee.tar.gz |
beta 2011.02.04 00:30
Diffstat (limited to 'tex/context/base/l-dir.lua')
-rw-r--r-- | tex/context/base/l-dir.lua | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/tex/context/base/l-dir.lua b/tex/context/base/l-dir.lua index 878698b16..2c4ff999b 100644 --- a/tex/context/base/l-dir.lua +++ b/tex/context/base/l-dir.lua @@ -59,22 +59,20 @@ end --~ end local function globpattern(path,patt,recurse,action) - if isdir(path) then - if path == "/" then - path = path .. "." - elseif not find(path,"/$") then - path = path .. '/' - end - for name in walkdir(path) do - local full = path .. name - local mode = attributes(full,'mode') - if mode == 'file' then - if find(full,patt) then - action(full) - end - elseif recurse and (mode == "directory") and (name ~= '.') and (name ~= "..") then - globpattern(full,patt,recurse,action) + if path == "/" then + path = path .. "." + elseif not find(path,"/$") then + path = path .. '/' + end + for name in walkdir(path) do + local full = path .. name + local mode = attributes(full,'mode') + if mode == 'file' then + if find(full,patt) then + action(full) end + elseif recurse and (mode == "directory") and (name ~= '.') and (name ~= "..") then + globpattern(full,patt,recurse,action) end end end |