From dfb47f7d4eceb6cef0507c9c1e7d5f758e442568 Mon Sep 17 00:00:00 2001 From: Manuel Pégourié-Gonnard Date: Thu, 31 Jul 2008 12:46:17 +0000 Subject: 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 --- Master/texmf/scripts/texlive/texdoc.tlu | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) (limited to 'Master/texmf') 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 -- cgit v1.2.3