summaryrefslogtreecommitdiff
blob: 20e2cf4e5b5cbbe6edf43f799d73232861e8533a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
--- texmf-dist/scripts/context/stubs/unix/luatools	2010-06-11 01:27:28.000000000 -0400
+++ texmf-dist/scripts/context/stubs/unix/luatools.new	2011-05-18 10:21:42.575032665 -0400
@@ -2723,15 +2723,15 @@
 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
@@ -2748,16 +2748,16 @@
 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