From d6ac6a6734f56dafac6d47e4a2d409d287fb668c Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 16 Aug 2021 03:00:42 +0000 Subject: CTAN sync 202108160300 --- indexing/xindex/lualatex/xindex-lapp.lua | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'indexing/xindex/lualatex/xindex-lapp.lua') 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 -- cgit v1.2.3