diff options
author | Khaled Hosny <khaledhosny@eglug.org> | 2011-01-20 20:32:53 +0200 |
---|---|---|
committer | Khaled Hosny <khaledhosny@eglug.org> | 2011-01-20 20:32:53 +0200 |
commit | ebac0e8e8d5d57eec5dfd3a3217e7e2fc3fe9bbd (patch) | |
tree | af8efbbd6701fe97b08c94a332956c407f0168c4 /lualibs-dir.lua | |
parent | 741fbdac61c0f8c7ec9394b9fd4e3e83caf062b4 (diff) | |
download | lualibs-ebac0e8e8d5d57eec5dfd3a3217e7e2fc3fe9bbd.tar.gz |
Fix computability with lfs in luatex 0.65
Patch by Paul Vojta:
http://tug.org/pipermail/tex-live/2011-January/028402.html
closes #2
Diffstat (limited to 'lualibs-dir.lua')
-rw-r--r-- | lualibs-dir.lua | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lualibs-dir.lua b/lualibs-dir.lua index 2643f53..1b9bcbc 100644 --- a/lualibs-dir.lua +++ b/lualibs-dir.lua @@ -26,15 +26,15 @@ local attributes = lfs.attributes local walkdir = lfs.dir local function glob_pattern(path,patt,recurse,action) - local ok, scanner + local ok, scanner, dirobj if path == "/" then - ok, scanner = xpcall(function() return walkdir(path..".") end, function() end) -- kepler safe + ok, scanner, dirobj = xpcall(function() return walkdir(path..".") end, function() end) -- kepler safe else - ok, scanner = xpcall(function() return walkdir(path) end, function() end) -- kepler safe + ok, scanner, dirobj = xpcall(function() return walkdir(path) end, function() end) -- kepler safe end if ok and type(scanner) == "function" then if not find(path,"/$") then path = path .. '/' end - for name in scanner do + for name in scanner, dirobj do local full = path .. name local mode = attributes(full,'mode') if mode == 'file' then @@ -51,16 +51,16 @@ end dir.glob_pattern = glob_pattern local function collect_pattern(path,patt,recurse,result) - local ok, scanner + local ok, scanner, dirobj result = result or { } if path == "/" then - ok, scanner = xpcall(function() return walkdir(path..".") end, function() end) -- kepler safe + ok, scanner, dirobj = xpcall(function() return walkdir(path..".") end, function() end) -- kepler safe else - ok, scanner = xpcall(function() return walkdir(path) end, function() end) -- kepler safe + ok, scanner, dirobj = xpcall(function() return walkdir(path) end, function() end) -- kepler safe end if ok and type(scanner) == "function" then if not find(path,"/$") then path = path .. '/' end - for name in scanner do + for name in scanner, dirobj do local full = path .. name local attr = attributes(full) local mode = attr.mode |