summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-11-06 00:03:34 +0000
committerKarl Berry <karl@freefriends.org>2017-11-06 00:03:34 +0000
commit3e05f904513bfc27ae6875cc098b73f6e52deaa5 (patch)
treee37647a70725123bd4ac284b7f5611448ec4fbd0 /Master
parent24f27b13d3ff59a9fc025ce009af154a95fd9acf (diff)
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
Diffstat (limited to 'Master')
-rw-r--r--Master/texmf-dist/scripts/texdoc/view.tlu4
1 files changed, 2 insertions, 2 deletions
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