summaryrefslogtreecommitdiff
path: root/Master/texmf
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf')
-rwxr-xr-xMaster/texmf/scripts/texlive/texdoc.tlu26
1 files changed, 10 insertions, 16 deletions
diff --git a/Master/texmf/scripts/texlive/texdoc.tlu b/Master/texmf/scripts/texlive/texdoc.tlu
index 9be5d3de0d1..eabba8a59a3 100755
--- a/Master/texmf/scripts/texlive/texdoc.tlu
+++ b/Master/texmf/scripts/texlive/texdoc.tlu
@@ -553,25 +553,19 @@ function how_to_view (filename)
.. filename .. ';' .. config.rm_dir .. tmpdir
end
else
- ext = string.match(filename,'.*%.(.*)$')
viewer_replacement = filename
- viewext = ext
- if not viewext then
- print ("texdoc warning: cannot determine file type for\n"..
- filename..", assuming text.")
+ -- files without extension are assumed to be text
+ viewext = string.match(filename,'.*%.(.*)$') or 'txt'
+ if not config['viewer_'..viewext] then
+ print ("texdoc warning: cannot determine type of file\n\t"
+ ..filename.."Assuming text. Set the `viewer_"..viewext..
+ "' variable in texdoc.cnf to avoid this.")
viewext = 'txt'
- else
if not config['viewer_'..viewext] then
- print ("texdoc warning: no "..viewext.." viewer found, "..
- "using text viewer instead.\nYou can select you preffered"..
- "with the viewer_"..viewext.." variable in texdoc.cnf.")
- viewext = 'fallback'
- if not config['viewer_'..viewext] then
- print ("texdoc error: text viewer not found. "..
- "Skipping file "..filename..".")
- end
- end -- viewer for ext
- end -- no ext
+ print ("texdoc error: text viewer not found. This "..
+ "should not happen, sorry. Skipping\n\t"..filename)
+ end
+ end -- viewer for ext
end -- zipped or not
return config['viewer_'..viewext], viewer_replacement
end