diff options
author | Norbert Preining <norbert@preining.info> | 2021-08-16 03:00:42 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2021-08-16 03:00:42 +0000 |
commit | d6ac6a6734f56dafac6d47e4a2d409d287fb668c (patch) | |
tree | 3aed824d94fa2f90061ded6f4f6d17aadb5aaf37 /indexing/xindex/lualatex/xindex-lapp.lua | |
parent | 8e38006fd2e220c3a27208477dab7abbf7256370 (diff) |
CTAN sync 202108160300
Diffstat (limited to 'indexing/xindex/lualatex/xindex-lapp.lua')
-rw-r--r-- | indexing/xindex/lualatex/xindex-lapp.lua | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/indexing/xindex/lualatex/xindex-lapp.lua b/indexing/xindex/lualatex/xindex-lapp.lua index cb79a0d550..e380413336 100644 --- a/indexing/xindex/lualatex/xindex-lapp.lua +++ b/indexing/xindex/lualatex/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 |