diff --git a/en/cgi/man.cgi b/en/cgi/man.cgi index 7433ac190a..95b20f9e34 100755 --- a/en/cgi/man.cgi +++ b/en/cgi/man.cgi @@ -33,7 +33,7 @@ # BSDI Id: bsdi-man,v 1.2 1995/01/11 02:30:01 polk Exp # Dual CGI/Plexus mode and new interface by sanders@bsdi.com 9/22/1995 # -# $Id: man.cgi,v 1.175 2007-06-12 19:09:50 wosch Exp $ +# $Id: man.cgi,v 1.176 2007-07-16 17:33:41 wosch Exp $ ############################################################################ # !!! man.cgi is stale perl4 code !!! @@ -430,6 +430,7 @@ $manstat = 'http://www.de.freebsd.org/de/stat/man'; unless defined($main'plexus_configured); $enable_include_links = 0; +$enable_mailto_links = 0; # Plexus Native Interface sub do_man { @@ -813,7 +814,7 @@ sub man { s,((<[IB]>)?[\w\_\.\-]+\s*()?\s*\(([1-9ln][a-zA-Z]*)\)),&mlnk($1),oige; # detect E-Mail Addreses in manpages - if (/\@/) { + if ($enable_mailto_links && /\@/) { s/([a-z0-9_\-\.]+\@[a-z0-9\-\.]+\.[a-z]+)/$1<\/A>/gi; } @@ -822,10 +823,10 @@ sub man { s,((ftp|http)://[^\s<>\)]+),$1,gi; } - if (/^\S+/ && m%^([^<]+)%) { - $i = $1; $j = &encode_url($i); - s%^([^<]+)%$i%; - push(@sect, $1); + if (s%^(.*?)+$% ($str = $1) =~ s,(|),,g; "$str" %ge ) { + $i = $_; $j = &encode_url($i); + $_ = qq{$i}; + push(@sect, $i); } print; } @@ -966,14 +967,15 @@ sub encode_data { s/\/\>\;/g; - s,((_\010.)+),($str = $1) =~ s/.\010//g; "$str";,ge; - s,(.\010)+,$1,g; - - if (!s,((.\010.)+\s+(.\010.)+),($str = $1) =~ s/.\010//g; "$str";,ge) { + s,((_\010[^_])+),($str = $1) =~ s/.\010//g; "$str";,ge; s,((.\010.)+),($str = $1) =~ s/.\010//g; "$str";,ge; - } - + #s,((_\010.)+),($str = $1) =~ s/.\010//g; "$str";,ge; + #s,(.\010)+,$1,g; + #if (!s,((.\010.)+\s+(.\010.)+),($str = $1) =~ s/.\010//g; "$str";,ge) { + # s,(([^_]\010.)+),($str = $1) =~ s/[^_]\010//g; "$str";,ge; + # s,(([_]\010.)+),($str = $1) =~ s/[_]\010//g; "$str";,ge; + #} # Escape binary data except for ^H which we process below # \375 gets turned into the & for the entity reference #s/([^\010\012\015\032-\176])/sprintf('\375#%03d;',ord($1))/eg; @@ -985,6 +987,7 @@ sub encode_data { # Now convert our magic chars into our tag markers #s/\375/\&/g; s/\376//g; + # cleanup all the rest s,.\010,,g; $_; @@ -1094,7 +1097,7 @@ ETX } sub copyright { - $id = '$Id: man.cgi,v 1.175 2007-06-12 19:09:50 wosch Exp $'; + $id = '$Id: man.cgi,v 1.176 2007-07-16 17:33:41 wosch Exp $'; return qq{\
@@ -1146,7 +1149,7 @@ sub faq {
 	     &encode_url($_) . "\n") if $manPathAliases{$_};
     }
 
-    local $id = '$Id: man.cgi,v 1.175 2007-06-12 19:09:50 wosch Exp $';
+    local $id = '$Id: man.cgi,v 1.176 2007-07-16 17:33:41 wosch Exp $';
     return qq{\
 
 Copyright (c) 1996-2007 Wolfram Schneider