diff options
Diffstat (limited to 'Master/texmf-dist/tex/lualatex/xindex/xindex-lapp.lua')
-rw-r--r-- | Master/texmf-dist/tex/lualatex/xindex/xindex-lapp.lua | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/Master/texmf-dist/tex/lualatex/xindex/xindex-lapp.lua b/Master/texmf-dist/tex/lualatex/xindex/xindex-lapp.lua index cb79a0d5502..e3804133369 100644 --- a/Master/texmf-dist/tex/lualatex/xindex/xindex-lapp.lua +++ b/Master/texmf-dist/tex/lualatex/xindex/xindex-lapp.lua @@ -1,7 +1,7 @@ -- lapp.lua -- Simple command-line parsing using human-readable specification -- --- $Id: xindex-lapp.lua 9 2021-08-13 19:42:48Z hvoss $ +-- $Id: xindex-lapp.lua 12 2021-08-15 09:28:32Z hvoss $ ----------------------------- --~ -- args.lua --~ local args = require ('lapp') [[ @@ -78,13 +78,18 @@ local function trim(s) return ltrim(rtrim(s)) end -local function open (file,opt) +--- open a file. +-- This will quit on error, and keep a list of file objects for later cleanup. +-- @string file filename +-- @string[opt] opt same as second parameter of `io.open` +function open (file,opt) local val,err = io.open(file,opt) if not val then - val,err = io.open(file..".idx",opt) - if not val then - error(err,true) - end + file = file..".idx" + val,err = io.open(file,opt) + if not val then + error(err,true) + end end append(open_files,val) return val |