From 62a87def961821679e455f333a58bc8c357e0457 Mon Sep 17 00:00:00 2001 From: Dirk Koopman Date: Mon, 20 Apr 2020 14:55:13 +0100 Subject: [PATCH] fix sh/log things to allow all search strings Search strings are escaped so can't be regexes (but that could change) --- cmd/show/announce.pl | 6 ++++++ cmd/show/chat.pl | 3 +++ cmd/show/log.pl | 2 +- cmd/show/rcmd.pl | 4 +++- cmd/show/talk.pl | 3 +++ 5 files changed, 16 insertions(+), 2 deletions(-) diff --git a/cmd/show/announce.pl b/cmd/show/announce.pl index 2820c6c7..267d27c3 100644 --- a/cmd/show/announce.pl +++ b/cmd/show/announce.pl @@ -28,6 +28,12 @@ while ($f = shift @f) { # next field next if $to; } next if $who; + if ($f !~ /^\d+/) { + ($who) = $f; + } + if ($f !~ /^\d+/) { + ($who) = $f; + } #($who) = $f =~ /^(\w+)/o; } diff --git a/cmd/show/chat.pl b/cmd/show/chat.pl index cc251c10..6e209e25 100644 --- a/cmd/show/chat.pl +++ b/cmd/show/chat.pl @@ -28,6 +28,9 @@ while ($f = shift @f) { # next field next if $to; } next if $who; + if ($f !~ /^\d+/) { + ($who) = $f; + } # ($who) = $f =~ /^(\w+)/o; } diff --git a/cmd/show/log.pl b/cmd/show/log.pl index 82356bcd..b1023f29 100644 --- a/cmd/show/log.pl +++ b/cmd/show/log.pl @@ -27,7 +27,7 @@ sub handle ($to) = $f =~ /^(\d+)$/o if !$to; # is it a to count? next if $to; } - unless ($who) { + unless ($f =~ /^\d+/) { $who = $f; next if $who; } diff --git a/cmd/show/rcmd.pl b/cmd/show/rcmd.pl index 7cd02d5d..0a362075 100644 --- a/cmd/show/rcmd.pl +++ b/cmd/show/rcmd.pl @@ -27,7 +27,9 @@ while ($f = shift @f) { # next field next if $to; } next if $who; - #($who) = $f =~ /^(\w+)/o; + if ($f !~ /^\d+/) { + ($who) = $f; + } } $to = 20 unless $to; diff --git a/cmd/show/talk.pl b/cmd/show/talk.pl index 811719d7..6b3c4ea9 100644 --- a/cmd/show/talk.pl +++ b/cmd/show/talk.pl @@ -25,6 +25,9 @@ while ($f = shift @f) { # next field next if $to; } next if $who; + if ($f !~ /^\d+/) { + ($who) = $f; + } # ($who) = $f =~ /^(\w+)/o; } -- 2.43.0