We now really display the pattern itself, NOT the matched string
authorshort <>
Mon, 7 Jan 2002 02:29:37 +0000 (02:29 +0000)
committershort <>
Mon, 7 Jan 2002 02:29:37 +0000 (02:29 +0000)
redirector

index 74d3b58..1d7718b 100755 (executable)
@@ -5,6 +5,8 @@
 use strict;
 use warnings;
 
+use re 'eval';
+
 use constant DIR_AD => "/usr/local/squid/etc/ad";
 
 
@@ -16,7 +18,9 @@ while (<M4>) {
        chomp;
        next if !$_;
        $patt.="|" if $patt;
-       $patt.=$_;
+       $patt.=$_."(?{ '";
+       s/'/'."'".'/g;
+       $patt.="$_'; })";
        }
 close M4;
 
@@ -24,6 +28,6 @@ select STDOUT;
 $|=1;
 
 while (<>) {
-       s@^http://($patt).*\n$@http://localhost/cgi-bin/redirector-ad.cgi?$1\n@os;
+       s@^http://($patt).*\n$@http://localhost/cgi-bin/redirector-ad.cgi?$^R\n@os;
        print;
        }