From: minima Date: Sun, 5 Nov 2000 21:19:39 +0000 (+0000) Subject: fixed fast log printing X-Git-Tag: R_1_45~36 X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=commitdiff_plain;h=96461da2f857d65129b2e6acd19bd075984c31f1;p=spider.git fixed fast log printing --- diff --git a/cmd/show/announce.pl b/cmd/show/announce.pl index bd6e05ae..350ff0ef 100644 --- a/cmd/show/announce.pl +++ b/cmd/show/announce.pl @@ -34,5 +34,5 @@ while ($f = shift @f) { # next field $to = 20 unless $to; $from = 0 unless $from; -@out = DXLog::print($from, $to, $main::systime, '^ann', $who); +@out = DXLog::print($from, $to, $main::systime, 'ann', $who); return (1, @out); diff --git a/cmd/show/log.pl b/cmd/show/log.pl index 8a00e385..570286f3 100644 --- a/cmd/show/log.pl +++ b/cmd/show/log.pl @@ -35,5 +35,5 @@ if ($self->priv < 6) { return (1, $self->msg('e5')) if $who ne $self->call; } -@out = DXLog::print($from, $to, $main::systime, $who); +@out = DXLog::print($from, $to, $main::systime, undef, $who); return (1, @out); diff --git a/cmd/show/rcmd.pl b/cmd/show/rcmd.pl index bc3a71f9..d8f02d5e 100644 --- a/cmd/show/rcmd.pl +++ b/cmd/show/rcmd.pl @@ -33,5 +33,5 @@ while ($f = shift @f) { # next field $to = 20 unless $to; $from = 0 unless $from; -@out = DXLog::print($from, $to, $main::systime, '^rcmd', $who); +@out = DXLog::print($from, $to, $main::systime, 'rcmd', $who); return (1, @out); diff --git a/cmd/show/talk.pl b/cmd/show/talk.pl index 93b0ab9a..81d6dc06 100644 --- a/cmd/show/talk.pl +++ b/cmd/show/talk.pl @@ -35,5 +35,5 @@ if ($self->priv < 6) { return (1, $self->msg('e5')) if $who ne $self->call; } -@out = DXLog::print($from, $to, $main::systime, '^talk', $who); +@out = DXLog::print($from, $to, $main::systime, 'talk', $who); return (1, @out); diff --git a/perl/DXLogPrint.pm b/perl/DXLogPrint.pm index 58f18ffd..6d37cb41 100644 --- a/perl/DXLogPrint.pm +++ b/perl/DXLogPrint.pm @@ -37,12 +37,10 @@ sub print my $count; my $hint = ""; - $search = '1' unless $pattern || $who; if ($pattern) { - $search = "\$ref->[1] =~ m{$pattern}i"; + $search = "\$ref->[1] =~ m{^$pattern}i"; $hint = "m{$pattern}i"; } - if ($who) { if ($search) { $search .= ' && '; @@ -52,6 +50,7 @@ sub print $hint .= 'm{$who}i'; } $hint = "next unless $hint" if $hint; + $search = "1" unless $search; $eval = qq( \@in = ();