summaryrefslogtreecommitdiff
path: root/Master/texmf/scripts
diff options
context:
space:
mode:
authorManuel Pégourié-Gonnard <mpg@elzevir.fr>2008-07-31 12:46:17 +0000
committerManuel Pégourié-Gonnard <mpg@elzevir.fr>2008-07-31 12:46:17 +0000
commitdfb47f7d4eceb6cef0507c9c1e7d5f758e442568 (patch)
treef9dd1828c211312a272b975bcce230e337f428f1 /Master/texmf/scripts
parentcfc694861f793e32261fe8b1f6125b6740604ae0 (diff)
Silently assume text for files without ext. Assume text with a warning
otherwise. Rm the reference to the non-longer used fallback viewer. git-svn-id: svn://tug.org/texlive/trunk@9934 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf/scripts')
-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