From 3e05f904513bfc27ae6875cc098b73f6e52deaa5 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 6 Nov 2017 00:03:34 +0000 Subject: off-by-one error in finding last valid document number, texdoc r19 git-svn-id: svn://tug.org/texlive/trunk@45703 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/scripts/texdoc/view.tlu | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Master/texmf-dist') diff --git a/Master/texmf-dist/scripts/texdoc/view.tlu b/Master/texmf-dist/scripts/texdoc/view.tlu index 484cfe34344..9b96e7619d2 100644 --- a/Master/texmf-dist/scripts/texdoc/view.tlu +++ b/Master/texmf-dist/scripts/texdoc/view.tlu @@ -158,13 +158,13 @@ function print_menu(name, doclist, showall) end local i, doc, last_i for i, doc in ipairs (doclist) do - last_i = i -- save for test below if doc.quality == 'killed' then break end if doc.quality ~= 'good' and not showall then break end if config.machine_switch == true then print(name, doc.score, w32_path(doc.realpath), doc.lang or '', doc.details or '') else + last_i = i -- save for test below print(string.format('%2d %s', i, w32_path(doc.realpath))) if doc.details or doc.lang then local line = ' = ' @@ -182,7 +182,7 @@ function print_menu(name, doclist, showall) -- We only want to default to viewing 1 on an empty line. -- Use Lua's faked ternary operator for fun and brevity: num = (num_str == "" and 1 or tonumber(num_str)) - if num and doclist[num] and num < last_i then + if num and doclist[num] and num <= last_i then view_doc(doclist[num]) end end -- cgit v1.2.3