ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/web/cgi-bin/docs.cgi
(Generate patch)

Comparing web/cgi-bin/docs.cgi (file contents):
Revision 1.2 by tdb, Thu Nov 2 20:59:43 2000 UTC vs.
Revision 1.3 by tdb, Thu Nov 9 22:03:56 2000 UTC

# Line 77 | Line 77 | exit 0;
77  
78   # Print a file, whilst escaping HTML: -
79   sub print_file ($) {
80 +    my ($urls) = '(' . join ('|', qw{
81 +                       http
82 +                       telnet
83 +                       gopher
84 +                       file
85 +                       wais
86 +                       ftp
87 +                       } )
88 +                   . ')';
89 +    
90 +    my ($ltrs) = '\w';
91 +    my ($gunk) = '/#~:.?+=&%@!\-';
92 +    my ($punc) = '.:?\-';
93 +    my ($any) = "${ltrs}${gunk}${punc}";
94      my ($filename) = @_;
95      open(FILE, $filename) or die "Cannot open $filename: $!\n";
96      print "<pre>\n";
# Line 87 | Line 101 | sub print_file ($) {
101          s/</&lt;/g;
102          s/>/&gt;/g;
103          s/"/&quot;/g;
104 +        s/\b($urls:[$any]+?)(?=[$punc]*[^$any]|$)/<a href="$1">$1<\/a>/igox;
105          print;
106      }
107      print "</pre>";

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines