diff options
author | Karl Berry <karl@freefriends.org> | 2021-08-15 20:25:47 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-08-15 20:25:47 +0000 |
commit | 4efec5365d341d5fa255bab3d3f3f9e9b7e33ec4 (patch) | |
tree | 2cbaf517877b6d3fc98293e82d9ab2fb88c9f03a /Master/texmf-dist/tex/lualatex/xindex/xindex-lapp.lua | |
parent | f65ec7271b9337bfe2710a83a853ae1e2dfa865c (diff) |
xindex (15aug21)
git-svn-id: svn://tug.org/texlive/trunk@60248 c570f23f-e606-0410-a88d-b1316a301751
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 |