From: Fabian Keil <fk@fabiankeil.de>
Date: Sun, 27 Nov 2022 18:20:57 +0000 (+0100)
Subject: privoxy-log-parser: Properly highlight a log message that now has a period
X-Git-Tag: v_3_0_34~46
X-Git-Url: http://www.privoxy.org/gitweb/@default-cgi@/faq/%22https:/%22show-proxy-args/static/@url@?a=commitdiff_plain;h=87481f59493b19c95bd7dd4664dc4bc8408dc602;p=privoxy.git

privoxy-log-parser: Properly highlight a log message that now has a period
---

diff --git a/tools/privoxy-log-parser.pl b/tools/privoxy-log-parser.pl
index 52105fb5..c58726c2 100755
--- a/tools/privoxy-log-parser.pl
+++ b/tools/privoxy-log-parser.pl
@@ -1805,8 +1805,13 @@ sub handle_loglevel_connect($) {
     } elsif ($c =~ m/^Optimistically sending /) {
 
         # Optimistically sending 318 bytes of client headers intended for www.privoxy.org
+        # Optimistically sending 318 bytes of client headers intended for www.privoxy.org.
         $c =~ s@(?<=sending )(\d+)@$h{'Number'}$1$h{'Standard'}@;
-        $c = highlight_matched_host($c, '(?<=for )[^\s]+');
+        if ($c =~ /\.$/) {
+            $c = highlight_matched_host($c, '[^\s]+(?=\.)');
+        } else {
+            $c = highlight_matched_host($c, '(?<=for )[^\s]+');
+        }
 
     } elsif ($c =~ m/^Stopping to watch the client socket/) {