X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/sw-tools/blobdiff_plain/9abee809f51da26598bf24572d9b14fa13a455bd..44b3c5890c87bc795256cd75bdd32d4279336aa9:/perl/SWInfo.pm diff --git a/perl/SWInfo.pm b/perl/SWInfo.pm index 04898df..276ac05 100644 --- a/perl/SWInfo.pm +++ b/perl/SWInfo.pm @@ -1,6 +1,6 @@ # -*-perl-*- # -# $Id: SWInfo.pm,v 1.1 1999/07/30 18:46:37 mdw Exp $ +# $Id: SWInfo.pm,v 1.2 1999/08/18 17:10:07 mdw Exp $ # # Read and output GNU Info files # @@ -28,6 +28,9 @@ #----- Revision history ----------------------------------------------------- # # $Log: SWInfo.pm,v $ +# Revision 1.2 1999/08/18 17:10:07 mdw +# Slight improvements to URL and email address parsing. +# # Revision 1.1 1999/07/30 18:46:37 mdw # New CGI script for browsing installed software and documentation. # @@ -141,8 +144,8 @@ sub info { } $out .= $n; - $out =~ s!(http|ftp)://[^]&)\s]*[^]&).,\s\'\"]!$&!g; - $out =~ s![^\s()&;{}.,\`\"][^\s()&;{}\`\"]*\@[^\s()&;{}\'\"]*[^\s()&;{}.,\'\"]!$&!g; + $out =~ s!\b(https?|ftp|file|news):[^]&)\s]*[^]&).,\s\'\"]!$&!g; + $out =~ s!(?:\bmailto:)?([^\s()&;:{}.,\`\"][^\s()&;:{}\`\"]*\@[^\s()&;:{}\'\"]*[^\s()&;:{}.,\'\"])!$&!g; $out =~ s!([-_.\w]+)\((\d+\w*)\)!SWMan::subst("$1($2)", $1, $2)!eg; header("Info: ($file)$node");