From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 208911F4B4; Sat, 26 Dec 2020 12:25:42 +0000 (UTC) Date: Sat, 26 Dec 2020 12:25:42 +0000 From: Eric Wong To: Ali Alnubani Cc: meta@public-inbox.org Subject: [PATCH] eml: fix undefined vars on References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: List-Id: Ali Alnubani wrote: > Hi, > > I see errors similar to the following in Debian 9 (stretch) with Perl 5.24: > """ > Use of uninitialized value in subroutine entry at /usr/lib/x86_64-linux-gnu/perl5/5.24/Encode/MIME/Header.pm line 198. Thanks for the bug report, it looks like the default was only applied in top-level Encode::decode() wrapper and not the per-object ->decode callbacks which we use with find_encoding(). (separate patch coming for the t/config.t fix) -----------8<----------- Subject: [PATCH] eml: fix undefined vars on Link: https://public-inbox.org/meta/DM6PR12MB49106F8E3BD697B63B943A22DADB0@DM6PR12MB4910.namprd12.prod.outlook.com/ --- lib/PublicInbox/Eml.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/PublicInbox/Eml.pm b/lib/PublicInbox/Eml.pm index 571edc5c..4d3fffc0 100644 --- a/lib/PublicInbox/Eml.pm +++ b/lib/PublicInbox/Eml.pm @@ -378,7 +378,9 @@ sub header_str_set { header_set($self, $name, @vals); } -sub mhdr_decode ($) { eval { $MIME_Header->decode($_[0]) } // $_[0] } +sub mhdr_decode ($) { + eval { $MIME_Header->decode($_[0], Encode::FB_DEFAULT) } // $_[0]; +} sub filename { my $dis = header_raw($_[0], 'Content-Disposition');