diff options
author | Marius <mariausol@gmail.com> | 2012-12-24 21:40:31 +0200 |
---|---|---|
committer | Marius <mariausol@gmail.com> | 2012-12-24 21:40:31 +0200 |
commit | 31c8bf0930a6d3e353a552d6bab71f62bc25f34e (patch) | |
tree | f9fd41e91d4751cdddd2bdfc15ae69f78b61f73f /tex/context/base/luat-exe.lua | |
parent | 1c36d2cc9c25d74a806ee74c0ee28da32d5e84ba (diff) | |
download | context-31c8bf0930a6d3e353a552d6bab71f62bc25f34e.tar.gz |
beta 2012.12.24 20:08
Diffstat (limited to 'tex/context/base/luat-exe.lua')
-rw-r--r-- | tex/context/base/luat-exe.lua | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/tex/context/base/luat-exe.lua b/tex/context/base/luat-exe.lua index 0d5cb5abc..a57a5a006 100644 --- a/tex/context/base/luat-exe.lua +++ b/tex/context/base/luat-exe.lua @@ -10,6 +10,7 @@ if not modules then modules = { } end modules ['luat-exe'] = { local match, find, gmatch = string.match, string.find, string.gmatch local concat = table.concat +local select = select local report_executers = logs.reporter("system","executers") @@ -29,20 +30,20 @@ local spawn = osspawn local popen = iopopen local function register(...) - local t = { ... } - for k=1,#t do - local v = t[k] - permitted[#permitted+1] = (v == "*" and ".*") or v + for k=1,select("#",...) do + local v = select(k,...) + permitted[#permitted+1] = v == "*" and ".*" or v end end local function prepare(...) -- todo: make more clever first split local t = { ... } + local n = #n local one = t[1] - if #t == 1 then + if n == 1 then if type(one) == 'table' then - return one, concat(t," ",2,#t) + return one, concat(t," ",2,n) else local name, arguments = match(one,"^(.-)%s+(.+)$") if name and arguments then @@ -52,7 +53,7 @@ local function prepare(...) end end else - return one, concat(t," ",2,#t) + return one, concat(t," ",2,n) end end |