From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 2AFE4203E2 for ; Tue, 26 Jul 2016 01:00:49 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] learn: fix uninitialized variable Date: Tue, 26 Jul 2016 01:00:49 +0000 Message-Id: <20160726010049.18876-1-e@80x24.org> List-Id: Oops :x --- script/public-inbox-learn | 2 +- t/mda.t | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/script/public-inbox-learn b/script/public-inbox-learn index 09fd7c8..396ab48 100755 --- a/script/public-inbox-learn +++ b/script/public-inbox-learn @@ -57,7 +57,7 @@ foreach my $recipient (keys %dests) { my $git = PublicInbox::Git->new($git_dir); # We do not touch GIT_COMMITTER_* env here so we can track # who trained the message. - my $name = $ENV{GIT_COMMITTER_NAME} || $dst->{inbox}; + my $name = $ENV{GIT_COMMITTER_NAME} || $dst->{name}; my $email = $ENV{GIT_COMMITTER_EMAIL} || $recipient; my $im = PublicInbox::Import->new($git, $name, $email); diff --git a/t/mda.t b/t/mda.t index 32154bd..886b4cb 100644 --- a/t/mda.t +++ b/t/mda.t @@ -187,6 +187,7 @@ EOF # now train it local $ENV{GIT_AUTHOR_EMAIL} = 'trainer@example.com'; local $ENV{GIT_COMMITTER_EMAIL} = 'trainer@example.com'; + local $ENV{GIT_COMMITTER_NAME} = undef; IPC::Run::run([$learn, "spam"], \$msg); is($?, 0, "no failure from learning spam"); IPC::Run::run([$learn, "spam"], \$msg); -- EW