]> Sergey Matveev's repositories - public-inbox.git/commitdiff
daemon: fix uninitialized variable
authorEric Wong <e@80x24.org>
Sun, 8 May 2022 22:10:31 +0000 (22:10 +0000)
committerEric Wong <e@80x24.org>
Sun, 8 May 2022 23:02:07 +0000 (23:02 +0000)
And also replace an unnecessary substitution (s///) op with a
match (m//).

Fixes: 93a7b219d58aad86 ("public-inbox-netd: a multi-protocol superserver")
lib/PublicInbox/Daemon.pm

index 13cce1ec51abcf3499363e388b359db6bd7f4a1a..d08ce0f9a4148905e05b5b8321afeb9a12552350 100644 (file)
@@ -618,9 +618,9 @@ sub daemon_loop ($) {
        while (my ($k, $v) = each %tls_opt) {
                my $l = $k;
                $l =~ s!\A([^:]+)://!!;
-               my $scheme = $1;
+               my $scheme = $1 // '';
                my $xn = $xnetd->{$l} // $xnetd->{''};
-               if ($scheme =~ s!\A(?:https|imaps|nntps)!!) {
+               if ($scheme =~ m!\A(?:https|imaps|nntps)!) {
                        $post_accept{$l} = tls_start_cb($v, $xn->{post_accept});
                } elsif ($xn->{tlsd}) { # STARTTLS, $k eq '' is OK
                        $xn->{tlsd}->{accept_tls} = $v;