-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Reproduction steps:
- Run
texdoc <unknown-name> - Answer
1to the promptWould you like to search online? (y/N)
$ texdoc blahblah
Unfortunately, there are no good matches for "blahblah".
There may be online documentation available for "blahblah" at
https://texdoc.org/serve/blahblah/0
This documentation may be for a different version than you have installed.
Would you like to search online? (y/N) 1
...e/2025basic/texmf-dist/scripts/texdoc/texdoclib-view.tlu:24: attempt to index a nil value (local 'docfile')
Google told me that Andreas Eder encountered the same Lua error in May 2024, but it seems that didn't get reported to texdoc. Also noted the steps to trigger the error changed. http://ftp.tug.org/pipermail/tex-live/2024-May/050587.html
texdoc/script/texdoclib-view.tlu
Lines 21 to 25 in b62d3af
| -- view a document | |
| -- see texdoclib-search.tlu for the structure of the argument | |
| local function view_doc(docfile) | |
| M.view_file(docfile.realpath) | |
| end |
texdoc/script/texdoclib-view.tlu
Lines 298 to 310 in b62d3af
| if docs_installed and doclist[1] then | |
| write(C.badmatch_prompt) | |
| else | |
| write(C.nolocaldocs_prompt) | |
| end | |
| local ans = io.read('*line') | |
| if ans:match('^\r?[yY]') then | |
| M.view_file(url) | |
| elseif tonumber(ans) then | |
| view_doc(doclist[tonumber(ans)]) | |
| end |
C.badmatch_prompt and C.nolocaldocs_prompt share the same logic to process ans, but only the former accepts numbers, the latter only accepts [yYnN] (or, treat anything other than [yY] as false).
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working