git://git.jankratochvil.net
/
redirector-ad.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
208a48f
)
We now really display the pattern itself, NOT the matched string
author
short
<>
Mon, 7 Jan 2002 02:29:37 +0000
(
02:29
+0000)
committer
short
<>
Mon, 7 Jan 2002 02:29:37 +0000
(
02:29
+0000)
redirector
patch
|
blob
|
history
diff --git
a/redirector
b/redirector
index
74d3b58
..
1d7718b
100755
(executable)
--- a/
redirector
+++ b/
redirector
@@
-5,6
+5,8
@@
use strict;
use warnings;
use strict;
use warnings;
+use re 'eval';
+
use constant DIR_AD => "/usr/local/squid/etc/ad";
use constant DIR_AD => "/usr/local/squid/etc/ad";
@@
-16,7
+18,9
@@
while (<M4>) {
chomp;
next if !$_;
$patt.="|" if $patt;
chomp;
next if !$_;
$patt.="|" if $patt;
- $patt.=$_;
+ $patt.=$_."(?{ '";
+ s/'/'."'".'/g;
+ $patt.="$_'; })";
}
close M4;
}
close M4;
@@
-24,6
+28,6
@@
select STDOUT;
$|=1;
while (<>) {
$|=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;
}
print;
}