texlive[45703] Master/texmf-dist/scripts/texdoc/view.tlu: off-by-one

commits+karl at tug.org commits+karl at tug.org
Mon Nov 6 01:03:34 CET 2017


Revision: 45703
          http://tug.org/svn/texlive?view=revision&revision=45703
Author:   karl
Date:     2017-11-06 01:03:34 +0100 (Mon, 06 Nov 2017)
Log Message:
-----------
off-by-one error in finding last valid document number, texdoc r19

Revision Links:
--------------
    http://tug.org/svn/texlive?view=revision&revision=19

Modified Paths:
--------------
    trunk/Master/texmf-dist/scripts/texdoc/view.tlu

Modified: trunk/Master/texmf-dist/scripts/texdoc/view.tlu
===================================================================
--- trunk/Master/texmf-dist/scripts/texdoc/view.tlu	2017-11-05 23:51:11 UTC (rev 45702)
+++ trunk/Master/texmf-dist/scripts/texdoc/view.tlu	2017-11-06 00:03:34 UTC (rev 45703)
@@ -158,7 +158,6 @@
     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
@@ -165,6 +164,7 @@
             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 @@
         -- 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



More information about the tex-live-commits mailing list