3 # View some HOWTO doc file
5 require './man-lib.pl';
8 $in{'file'} = &simplify_path($in{'file'});
9 $in{'file'} !~ /[\\\&\;\`\'\"\|\*\?\~\<\>\^\(\)\[\]\{\}\$\n\r]/ ||
10 &error($text{'howto_epath'});
11 foreach $h (split(/\s+/, $config{'howto_dir'})) {
12 $ok++ if (&is_under_directory($h, $in{'file'}));
14 $ok || &error($text{'howto_epath'});
15 -r $in{'file'} || &error($text{'howto_epath'});
17 &ui_print_header(undef, $text{'howto_title'}, "");
19 # Work out compression format
20 open(FILE, $in{'file'});
22 $qm = quotemeta($in{'file'});
23 if ($two eq "\037\213") {
25 &open_execute_command(FILE, "gunzip -c $qm", 1, 1);
27 elsif ($two eq "BZ") {
29 &open_execute_command(FILE, "bunzip2 -c $qm", 1, 1);
34 @for = split(/\s+/, $in{'for'});
35 while($line = <FILE>) {
36 $line = &html_escape($line);
39 $line =~ s/($f)/<b>$1<\/b>/ig;
45 &show_view_table(&text('howto_header', $in{'file'}), $out);
47 &ui_print_footer("", $text{'index_return'});