[libmime-tools-perl] 01/10: Imported Upstream version 5.507

gregor herrmann gregoa at debian.org
Sun Dec 6 14:45:37 UTC 2015


This is an automated email from the git hooks/post-receive script.

gregoa pushed a commit to branch master
in repository libmime-tools-perl.

commit 79ef19737b466b342afa4444992dd0be699c604b
Author: gregor herrmann <gregoa at debian.org>
Date:   Sun Dec 6 15:30:51 2015 +0100

    Imported Upstream version 5.507
---
 ChangeLog                       | 49 +++++++++++++++++++++++++++--------------
 META.yml                        |  6 ++---
 Makefile.PL                     |  2 +-
 README                          |  2 +-
 inc/Module/Install.pm           | 22 ++++++++++--------
 inc/Module/Install/Base.pm      |  2 +-
 inc/Module/Install/Can.pm       |  2 +-
 inc/Module/Install/Fetch.pm     |  2 +-
 inc/Module/Install/Makefile.pm  |  4 ++--
 inc/Module/Install/Metadata.pm  |  6 ++---
 inc/Module/Install/Win32.pm     |  2 +-
 inc/Module/Install/WriteAll.pm  |  2 +-
 lib/MIME/Body.pm                |  4 ++--
 lib/MIME/Decoder.pm             |  2 +-
 lib/MIME/Decoder/Base64.pm      |  2 +-
 lib/MIME/Decoder/BinHex.pm      |  2 +-
 lib/MIME/Decoder/Binary.pm      |  2 +-
 lib/MIME/Decoder/Gzip64.pm      |  2 +-
 lib/MIME/Decoder/NBit.pm        |  2 +-
 lib/MIME/Decoder/QuotedPrint.pm |  2 +-
 lib/MIME/Decoder/UU.pm          |  2 +-
 lib/MIME/Entity.pm              |  6 ++---
 lib/MIME/Field/ConTraEnc.pm     |  4 ++--
 lib/MIME/Field/ContDisp.pm      |  4 ++--
 lib/MIME/Field/ContType.pm      |  4 ++--
 lib/MIME/Field/ParamVal.pm      | 15 +++++++++----
 lib/MIME/Head.pm                |  4 ++--
 lib/MIME/Parser.pm              |  4 ++--
 lib/MIME/Parser/Reader.pm       |  8 +++----
 lib/MIME/Tools.pm               |  4 ++--
 lib/MIME/WordDecoder.pm         |  2 +-
 lib/MIME/Words.pm               |  4 ++--
 t/Entity.t                      | 41 +++++++++++++++++++++++++++++++++-
 t/ParamVal.t                    | 28 ++++++++++++++++++++++-
 34 files changed, 170 insertions(+), 79 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index d98daef..f038c3e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,19 @@
-5.505	  2013-11-14  David F. Skoll <dfs at roaringpenguin.com>
+5.507	  2015-09-30  Dianne Skoll <dfs at roaringpenguin.com>
+
+	* VERSION 5.507 RELEASED
+
+	* Fix parsing bug
+	  https://rt.cpan.org/Public/Bug/Display.html?id=105455
+
+	* Fix typo that broke MIME::Body::incore->open() on Perl 5.20
+
+5.506	  2015-04-22  Dianne Skoll <dfs at roaringpenguin.com>
+
+	* VERSION 5.506 RELEASED
+
+	* Update maintainer's name to "Dianne Skoll"
+
+5.505	  2013-11-14  Dianne Skoll <dfs at roaringpenguin.com>
 
 	* VERSION 5.505 RELEASED
 
@@ -17,7 +32,7 @@
 	* Fix bug in header parsing that would fail to parse a header like:
  	      Content-Type: ; name="malware.zip"
 
-5.504	  2013-01-30  David F. Skoll <dfs at roaringpenguin.com>
+5.504	  2013-01-30  Dianne Skoll <dfs at roaringpenguin.com>
 
 	* VERSION 5.504 RELEASED
 
@@ -32,7 +47,7 @@
 	  break multibyte-encodings (eg, utf-8)
 	  https://rt.cpan.org/Public/Bug/Display.html?id=5462
 
-5.503	  2012-06-08  David F. Skoll <dfs at roaringpenguin.com>
+5.503	  2012-06-08  Dianne Skoll <dfs at roaringpenguin.com>
 
 	* VERSION 5.503 RELEASED
 
@@ -66,7 +81,7 @@
 	* Add "use strict" everywhere
 	  https://rt.cpan.org/Public/Bug/Display.html?id=77582
 
-5.502	  2011-03-08  David F. Skoll <dfs at roaringpenguin.com>
+5.502	  2011-03-08  Dianne Skoll <dfs at roaringpenguin.com>
 
 	* VERSION 5.502 RELEASED
 
@@ -81,7 +96,7 @@
 
 	* Fix unit test failure on Win32:  (https://rt.cpan.org/Ticket/Display.html?id=66286)
 
-5.501	  2011-02-17  David F. Skoll <dfs at roaringpenguin.com>
+5.501	  2011-02-17  Dianne Skoll <dfs at roaringpenguin.com>
 
 	* VERSION 5.501 RELEASED
 
@@ -187,7 +202,7 @@
 	  never worked and has been removed, any code calling tmp_recycling()
 	  should stop attempting to use the feature.
 
-5.424     2007-11-07  David Skoll <dfs at roaringpenguin.com>
+5.424     2007-11-07  Dianne Skoll <dfs at roaringpenguin.com>
 
 	* VERSION 5.424 RELEASED
 
@@ -267,14 +282,14 @@
 	* (cleanup) Merge all changelog information from README and
 	  MIME/Tools.pm into ChangeLog
 
-5.420     2006-03-17  David F. Skoll  <dfs at roaringpenguin.com>
+5.420     2006-03-17  Dianne Skoll  <dfs at roaringpenguin.com>
 
 	* VERSION 5.420 RELEASED
 
 	* Fix regression introduced in 5.419 -- quoted-printable
 	encoding would sometimes fail on "textual" MIME parts.
 
-5.419     2005-12-22  David F. Skoll  <dfs at roaringpenguin.com>
+5.419     2005-12-22  Dianne Skoll  <dfs at roaringpenguin.com>
 
 	* VERSION 5.419 RELEASED
 
@@ -283,7 +298,7 @@
 	if you need the exact unmangled message source (for example,
 	for GPG-signing.)  Patch submitted by J�rn Reder.
 
-5.418     2005-09-29  David F. Skoll  <dfs at roaringpenguin.com>
+5.418     2005-09-29  Dianne Skoll  <dfs at roaringpenguin.com>
 
 	* VERSION 5.418 RELEASED
 
@@ -298,7 +313,7 @@
 	* MANIFEST: Remove some useless internal files from the manifest.
 	They were never meant to be part of the actual distribution.
 
-5.417     2005-01-20  David F. Skoll  <dfs at roaringpenguin.com>
+5.417     2005-01-20  Dianne Skoll  <dfs at roaringpenguin.com>
 
 	* VERSION 5.417 RELEASED
 
@@ -310,7 +325,7 @@
 	parameters was buggy and caused decoding errors.  This has been
 	fixed.
 
-5.416     2005-01-03  David F. Skoll  <dfs at roaringpenguin.com>
+5.416     2005-01-03  Dianne Skoll  <dfs at roaringpenguin.com>
 
 	* VERSION 5.416 RELEASED
 
@@ -322,14 +337,14 @@
 	parameters.  Apparently, not doing so can cause Perl to core dump
 	on certain badly-formed messages.
 
-5.415     2004-10-27  David F. Skoll  <dfs at roaringpenguin.com>
+5.415     2004-10-27  Dianne Skoll  <dfs at roaringpenguin.com>
 
 	* VERSION 5.415 RELEASED
 
 	* Fixed parsing of parameter="" in headers, and fixed case where
 	multipart boundary is ""
 
-5.414     2004-10-06  David F. Skoll  <dfs at roaringpenguin.com>
+5.414     2004-10-06  Dianne Skoll  <dfs at roaringpenguin.com>
 
 	* VERSION 5.414 RELEASED
 
@@ -339,14 +354,14 @@
 	* Check return values of I/O operations like open(), close(), etc.
 	and die if they fail.  Problem reported by Mark Martinec.
 
-5.413     2004-09-15  David F. Skoll  <dfs at roaringpenguin.com>
+5.413     2004-09-15  Dianne Skoll  <dfs at roaringpenguin.com>
 
 	* VERSION 5.413 RELEASED
 
 	* Fix some $VERSION = xxx assignments that were broken; make sure
 	VERSION shows up as 5.413 everywhere.  Sorry about that!
 
-5.412     2004-09-09  David F. Skoll  <dfs at roaringpenguin.com>
+5.412     2004-09-09  Dianne Skoll  <dfs at roaringpenguin.com>
 
 	* VERSION 5.412 RELEASED
 
@@ -356,7 +371,7 @@
 	* Filer.pm: Be much more strict in evil_filename, allowing only
 	a set of known good characters.
 
-2004-09-08  David F. Skoll  <dfs at roaringpenguin.com>
+2004-09-08  Dianne Skoll  <dfs at roaringpenguin.com>
 
 	* Skip BinHex decoding if prerequisite modules not installed.
 
@@ -371,7 +386,7 @@
 
 	* Correct bad regexp test for "bad PDF" files.
 
-2004-09-07  David F. Skoll  <dfs at roaringpenguin.com>
+2004-09-07  Dianne Skoll  <dfs at roaringpenguin.com>
 
 	* lib/MIME/Parser/Filer.pm (evil_filename): Make evil_filename
 	more paranoid (Julian Field and Martin Blapp)
diff --git a/META.yml b/META.yml
index 945d1df..55cdd0c 100644
--- a/META.yml
+++ b/META.yml
@@ -1,7 +1,7 @@
 ---
 abstract: 'Tools to manipulate MIME messages'
 author:
-  - "Eryq <eryq at zeegee.com>, David F. Skoll <dfs at roaringpenguin.com>, Dave O'Neill <dmo at roaringpenguin.com>"
+  - "Eryq <eryq at zeegee.com>, Dianne Skoll <dfs at roaringpenguin.com>, Dave O'Neill <dmo at roaringpenguin.com>"
 build_requires:
   ExtUtils::MakeMaker: 6.59
   Test::Deep: 0
@@ -10,7 +10,7 @@ configure_requires:
   ExtUtils::MakeMaker: 6.59
 distribution_type: module
 dynamic_config: 1
-generated_by: 'Module::Install version 1.06'
+generated_by: 'Module::Install version 1.14'
 license: perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -38,4 +38,4 @@ requires:
   perl: 5.8.0
 resources:
   license: http://dev.perl.org/licenses/
-version: 5.505
+version: '5.507'
diff --git a/Makefile.PL b/Makefile.PL
index 3e4343b..a8d31b3 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -5,7 +5,7 @@ use inc::Module::Install;
 name            'MIME-tools';
 module_name     'MIME::Tools';
 version_from    'lib/MIME/Tools.pm';
-author          q{Eryq <eryq at zeegee.com>, David F. Skoll <dfs at roaringpenguin.com>, Dave O'Neill <dmo at roaringpenguin.com>};
+author          q{Eryq <eryq at zeegee.com>, Dianne Skoll <dfs at roaringpenguin.com>, Dave O'Neill <dmo at roaringpenguin.com>};
 abstract        'Tools to manipulate MIME messages';
 license         'perl';
 
diff --git a/README b/README
index 191d122..b4b7a3f 100644
--- a/README
+++ b/README
@@ -642,7 +642,7 @@ A MIME PRIMER
 
 TERMS AND CONDITIONS
     Eryq (eryq at zeegee.com), ZeeGee Software Inc (http://www.zeegee.com).
-    David F. Skoll (dfs at roaringpenguin.com) http://www.roaringpenguin.com
+    Dianne Skoll (dfs at roaringpenguin.com) http://www.roaringpenguin.com
 
     Copyright (c) 1998, 1999 by ZeeGee Software Inc (www.zeegee.com).
     Copyright (c) 2004 by Roaring Penguin Software Inc (www.roaringpenguin.com)
diff --git a/inc/Module/Install.pm b/inc/Module/Install.pm
index 4ecf46b..ff767fa 100644
--- a/inc/Module/Install.pm
+++ b/inc/Module/Install.pm
@@ -17,7 +17,7 @@ package Module::Install;
 #     3. The ./inc/ version of Module::Install loads
 # }
 
-use 5.005;
+use 5.006;
 use strict 'vars';
 use Cwd        ();
 use File::Find ();
@@ -31,7 +31,7 @@ BEGIN {
 	# This is not enforced yet, but will be some time in the next few
 	# releases once we can make sure it won't clash with custom
 	# Module::Install extensions.
-	$VERSION = '1.06';
+	$VERSION = '1.14';
 
 	# Storage for the pseudo-singleton
 	$MAIN    = undef;
@@ -156,10 +156,10 @@ END_DIE
 sub autoload {
 	my $self = shift;
 	my $who  = $self->_caller;
-	my $cwd  = Cwd::cwd();
+	my $cwd  = Cwd::getcwd();
 	my $sym  = "${who}::AUTOLOAD";
 	$sym->{$cwd} = sub {
-		my $pwd = Cwd::cwd();
+		my $pwd = Cwd::getcwd();
 		if ( my $code = $sym->{$pwd} ) {
 			# Delegate back to parent dirs
 			goto &$code unless $cwd eq $pwd;
@@ -239,7 +239,7 @@ sub new {
 
 	# ignore the prefix on extension modules built from top level.
 	my $base_path = Cwd::abs_path($FindBin::Bin);
-	unless ( Cwd::abs_path(Cwd::cwd()) eq $base_path ) {
+	unless ( Cwd::abs_path(Cwd::getcwd()) eq $base_path ) {
 		delete $args{prefix};
 	}
 	return $args{_self} if $args{_self};
@@ -338,7 +338,7 @@ sub find_extensions {
 		if ( $subpath eq lc($subpath) || $subpath eq uc($subpath) ) {
 			my $content = Module::Install::_read($subpath . '.pm');
 			my $in_pod  = 0;
-			foreach ( split //, $content ) {
+			foreach ( split /\n/, $content ) {
 				$in_pod = 1 if /^=\w/;
 				$in_pod = 0 if /^=cut/;
 				next if ($in_pod || /^=cut/);  # skip pod text
@@ -378,6 +378,7 @@ eval( $] >= 5.006 ? <<'END_NEW' : <<'END_OLD' ); die $@ if $@;
 sub _read {
 	local *FH;
 	open( FH, '<', $_[0] ) or die "open($_[0]): $!";
+	binmode FH;
 	my $string = do { local $/; <FH> };
 	close FH or die "close($_[0]): $!";
 	return $string;
@@ -386,6 +387,7 @@ END_NEW
 sub _read {
 	local *FH;
 	open( FH, "< $_[0]"  ) or die "open($_[0]): $!";
+	binmode FH;
 	my $string = do { local $/; <FH> };
 	close FH or die "close($_[0]): $!";
 	return $string;
@@ -416,6 +418,7 @@ eval( $] >= 5.006 ? <<'END_NEW' : <<'END_OLD' ); die $@ if $@;
 sub _write {
 	local *FH;
 	open( FH, '>', $_[0] ) or die "open($_[0]): $!";
+	binmode FH;
 	foreach ( 1 .. $#_ ) {
 		print FH $_[$_] or die "print($_[0]): $!";
 	}
@@ -425,6 +428,7 @@ END_NEW
 sub _write {
 	local *FH;
 	open( FH, "> $_[0]"  ) or die "open($_[0]): $!";
+	binmode FH;
 	foreach ( 1 .. $#_ ) {
 		print FH $_[$_] or die "print($_[0]): $!";
 	}
@@ -434,7 +438,7 @@ END_OLD
 
 # _version is for processing module versions (eg, 1.03_05) not
 # Perl versions (eg, 5.8.1).
-sub _version ($) {
+sub _version {
 	my $s = shift || 0;
 	my $d =()= $s =~ /(\.)/g;
 	if ( $d >= 2 ) {
@@ -450,12 +454,12 @@ sub _version ($) {
 	return $l + 0;
 }
 
-sub _cmp ($$) {
+sub _cmp {
 	_version($_[1]) <=> _version($_[2]);
 }
 
 # Cloned from Params::Util::_CLASS
-sub _CLASS ($) {
+sub _CLASS {
 	(
 		defined $_[0]
 		and
diff --git a/inc/Module/Install/Base.pm b/inc/Module/Install/Base.pm
index 802844a..4206347 100644
--- a/inc/Module/Install/Base.pm
+++ b/inc/Module/Install/Base.pm
@@ -4,7 +4,7 @@ package Module::Install::Base;
 use strict 'vars';
 use vars qw{$VERSION};
 BEGIN {
-	$VERSION = '1.06';
+	$VERSION = '1.14';
 }
 
 # Suspend handler for "redefined" warnings
diff --git a/inc/Module/Install/Can.pm b/inc/Module/Install/Can.pm
index 22167b8..9929b1b 100644
--- a/inc/Module/Install/Can.pm
+++ b/inc/Module/Install/Can.pm
@@ -8,7 +8,7 @@ use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.06';
+	$VERSION = '1.14';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
diff --git a/inc/Module/Install/Fetch.pm b/inc/Module/Install/Fetch.pm
index bee0c4f..3d8de76 100644
--- a/inc/Module/Install/Fetch.pm
+++ b/inc/Module/Install/Fetch.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.06';
+	$VERSION = '1.14';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
diff --git a/inc/Module/Install/Makefile.pm b/inc/Module/Install/Makefile.pm
index 7052f36..66993af 100644
--- a/inc/Module/Install/Makefile.pm
+++ b/inc/Module/Install/Makefile.pm
@@ -8,7 +8,7 @@ use Fcntl qw/:flock :seek/;
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.06';
+	$VERSION = '1.14';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
@@ -133,7 +133,7 @@ sub makemaker_args {
 	return $args;
 }
 
-# For mm args that take multiple space-seperated args,
+# For mm args that take multiple space-separated args,
 # append an argument to the current list.
 sub makemaker_append {
 	my $self = shift;
diff --git a/inc/Module/Install/Metadata.pm b/inc/Module/Install/Metadata.pm
index 58430f3..e547fa0 100644
--- a/inc/Module/Install/Metadata.pm
+++ b/inc/Module/Install/Metadata.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.06';
+	$VERSION = '1.14';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
@@ -347,7 +347,7 @@ sub name_from {
 		^ \s*
 		package \s*
 		([\w:]+)
-		\s* ;
+		[\s|;]*
 		/ixms
 	) {
 		my ($name, $module_name) = ($1, $1);
@@ -705,7 +705,7 @@ sub _write_mymeta_data {
 	my @yaml = Parse::CPAN::Meta::LoadFile('META.yml');
 	my $meta = $yaml[0];
 
-	# Overwrite the non-configure dependency hashs
+	# Overwrite the non-configure dependency hashes
 	delete $meta->{requires};
 	delete $meta->{build_requires};
 	delete $meta->{recommends};
diff --git a/inc/Module/Install/Win32.pm b/inc/Module/Install/Win32.pm
index eeaa3fe..9706e5f 100644
--- a/inc/Module/Install/Win32.pm
+++ b/inc/Module/Install/Win32.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.06';
+	$VERSION = '1.14';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
diff --git a/inc/Module/Install/WriteAll.pm b/inc/Module/Install/WriteAll.pm
index 85d8018..dbedc00 100644
--- a/inc/Module/Install/WriteAll.pm
+++ b/inc/Module/Install/WriteAll.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.06';
+	$VERSION = '1.14';
 	@ISA     = qw{Module::Install::Base};
 	$ISCORE  = 1;
 }
diff --git a/lib/MIME/Body.pm b/lib/MIME/Body.pm
index 3b5dcb4..0069a1d 100644
--- a/lib/MIME/Body.pm
+++ b/lib/MIME/Body.pm
@@ -141,7 +141,7 @@ use Carp;
 use IO::File;
 
 ### The package version, both in 1.23 style *and* usable by MakeMaker:
-$VERSION = "5.505";
+$VERSION = "5.507";
 
 
 #------------------------------
@@ -522,7 +522,7 @@ sub open {
 	    die "bad mode: $mode";
     }
 
-    return IO::File->new(\($self->{MBS_Data}), $mode);
+    return IO::File->new(\ $self->{MBS_Data}, $mode);
 }
 
 
diff --git a/lib/MIME/Decoder.pm b/lib/MIME/Decoder.pm
index 56873d2..dba562c 100644
--- a/lib/MIME/Decoder.pm
+++ b/lib/MIME/Decoder.pm
@@ -126,7 +126,7 @@ use Carp;
 );
 
 ### The package version, both in 1.23 style *and* usable by MakeMaker:
-$VERSION = "5.505";
+$VERSION = "5.507";
 
 ### Me:
 my $ME = 'MIME::Decoder';
diff --git a/lib/MIME/Decoder/Base64.pm b/lib/MIME/Decoder/Base64.pm
index 40838f2..95dc67f 100644
--- a/lib/MIME/Decoder/Base64.pm
+++ b/lib/MIME/Decoder/Base64.pm
@@ -60,7 +60,7 @@ use MIME::Tools qw(debug);
 @ISA = qw(MIME::Decoder);
 
 ### The package version, both in 1.23 style *and* usable by MakeMaker:
-$VERSION = "5.505";
+$VERSION = "5.507";
 
 ### How many bytes to encode at a time (must be a multiple of 3, and
 ### less than (76 * 0.75)!
diff --git a/lib/MIME/Decoder/BinHex.pm b/lib/MIME/Decoder/BinHex.pm
index d546767..2f0112c 100644
--- a/lib/MIME/Decoder/BinHex.pm
+++ b/lib/MIME/Decoder/BinHex.pm
@@ -47,7 +47,7 @@ use Convert::BinHex;
 @ISA = qw(MIME::Decoder);
 
 # The package version, both in 1.23 style *and* usable by MakeMaker:
-$VERSION = "5.505";
+$VERSION = "5.507";
 
 
 #------------------------------
diff --git a/lib/MIME/Decoder/Binary.pm b/lib/MIME/Decoder/Binary.pm
index 0b355cb..417bb2c 100644
--- a/lib/MIME/Decoder/Binary.pm
+++ b/lib/MIME/Decoder/Binary.pm
@@ -47,7 +47,7 @@ use vars qw(@ISA $VERSION);
 @ISA = qw(MIME::Decoder);
 
 ### The package version, both in 1.23 style *and* usable by MakeMaker:
-$VERSION = "5.505";
+$VERSION = "5.507";
 
 ### Buffer length:
 my $BUFLEN = 8192;
diff --git a/lib/MIME/Decoder/Gzip64.pm b/lib/MIME/Decoder/Gzip64.pm
index 2dae253..1073dd2 100644
--- a/lib/MIME/Decoder/Gzip64.pm
+++ b/lib/MIME/Decoder/Gzip64.pm
@@ -61,7 +61,7 @@ use MIME::Tools qw(tmpopen whine);
 @ISA = qw(MIME::Decoder::Base64);
 
 # The package version, both in 1.23 style *and* usable by MakeMaker:
-$VERSION = "5.505";
+$VERSION = "5.507";
 
 # How to compress stdin to stdout:
 $GZIP   = "gzip -c";
diff --git a/lib/MIME/Decoder/NBit.pm b/lib/MIME/Decoder/NBit.pm
index 06baba8..3f1e27b 100644
--- a/lib/MIME/Decoder/NBit.pm
+++ b/lib/MIME/Decoder/NBit.pm
@@ -98,7 +98,7 @@ use MIME::Tools qw(:msgs);
 @ISA = qw(MIME::Decoder);
 
 ### The package version, both in 1.23 style *and* usable by MakeMaker:
-$VERSION = "5.505";
+$VERSION = "5.507";
 
 ### How many bytes to decode at a time?
 my $DecodeChunkLength = 8 * 1024;
diff --git a/lib/MIME/Decoder/QuotedPrint.pm b/lib/MIME/Decoder/QuotedPrint.pm
index 61b9dd3..d43ae30 100644
--- a/lib/MIME/Decoder/QuotedPrint.pm
+++ b/lib/MIME/Decoder/QuotedPrint.pm
@@ -58,7 +58,7 @@ use MIME::QuotedPrint;
 @ISA = qw(MIME::Decoder);
 
 # The package version, both in 1.23 style *and* usable by MakeMaker:
-$VERSION = "5.505";
+$VERSION = "5.507";
 
 #------------------------------
 # If we have MIME::QuotedPrint 3.03 or later, use the three-argument
diff --git a/lib/MIME/Decoder/UU.pm b/lib/MIME/Decoder/UU.pm
index 3bc5401..6852674 100644
--- a/lib/MIME/Decoder/UU.pm
+++ b/lib/MIME/Decoder/UU.pm
@@ -48,7 +48,7 @@ use MIME::Tools qw(whine);
 @ISA = qw(MIME::Decoder);
 
 # The package version, both in 1.23 style *and* usable by MakeMaker:
-$VERSION = "5.505";
+$VERSION = "5.507";
 
 
 #------------------------------
diff --git a/lib/MIME/Entity.pm b/lib/MIME/Entity.pm
index 37d0de4..727ce1b 100644
--- a/lib/MIME/Entity.pm
+++ b/lib/MIME/Entity.pm
@@ -245,7 +245,7 @@ use MIME::Decoder;
 #------------------------------
 
 ### The package version, both in 1.23 style *and* usable by MakeMaker:
-$VERSION = "5.505";
+$VERSION = "5.507";
 
 ### Boundary counter:
 my $BCount = 0;
@@ -570,7 +570,7 @@ sub build {
     $filename = undef if (defined($filename) and $filename eq '');
 
     ### Type-check sanity:
-    if ($type =~ m{^(multipart|message)/}) {
+    if ($type =~ m{^(multipart/|message/(rfc822|partial|external-body|delivery-status|disposition-notification|feedback-report)$)}i) {
 	($encoding =~ /^(|7bit|8bit|binary|-suggest)$/i)
 	    or croak "can't have encoding $encoding for message type $type!";
     }
@@ -2250,7 +2250,7 @@ L<MIME::Tools>, L<MIME::Head>, L<MIME::Body>, L<MIME::Decoder>, L<Mail::Internet
 =head1 AUTHOR
 
 Eryq (F<eryq at zeegee.com>), ZeeGee Software Inc (F<http://www.zeegee.com>).
-David F. Skoll (dfs at roaringpenguin.com) http://www.roaringpenguin.com
+Dianne Skoll (dfs at roaringpenguin.com) http://www.roaringpenguin.com
 
 All rights reserved.  This program is free software; you can redistribute
 it and/or modify it under the same terms as Perl itself.
diff --git a/lib/MIME/Field/ConTraEnc.pm b/lib/MIME/Field/ConTraEnc.pm
index a39af00..985170f 100644
--- a/lib/MIME/Field/ConTraEnc.pm
+++ b/lib/MIME/Field/ConTraEnc.pm
@@ -35,7 +35,7 @@ L<MIME::Field::ParamVal>, L<Mail::Field>
 =head1 AUTHOR
 
 Eryq (F<eryq at zeegee.com>), ZeeGee Software Inc (F<http://www.zeegee.com>).
-David F. Skoll (dfs at roaringpenguin.com) http://www.roaringpenguin.com
+Dianne Skoll (dfs at roaringpenguin.com) http://www.roaringpenguin.com
 
 =cut
 
@@ -47,7 +47,7 @@ use vars qw($VERSION @ISA);
 @ISA = qw(MIME::Field::ParamVal);
 
 # The package version, both in 1.23 style *and* usable by MakeMaker:
-$VERSION = "5.505";
+$VERSION = "5.507";
 
 # Install it:
 bless([])->register('Content-transfer-encoding');
diff --git a/lib/MIME/Field/ContDisp.pm b/lib/MIME/Field/ContDisp.pm
index 7d60459..26a4970 100644
--- a/lib/MIME/Field/ContDisp.pm
+++ b/lib/MIME/Field/ContDisp.pm
@@ -35,7 +35,7 @@ L<MIME::Field::ParamVal>, L<Mail::Field>
 =head1 AUTHOR
 
 Eryq (F<eryq at zeegee.com>), ZeeGee Software Inc (F<http://www.zeegee.com>).
-David F. Skoll (dfs at roaringpenguin.com) http://www.roaringpenguin.com
+Dianne Skoll (dfs at roaringpenguin.com) http://www.roaringpenguin.com
 
 
 =cut
@@ -48,7 +48,7 @@ use vars qw($VERSION @ISA);
 @ISA = qw(MIME::Field::ParamVal);
 
 # The package version, both in 1.23 style *and* usable by MakeMaker:
-$VERSION = "5.505";
+$VERSION = "5.507";
 
 # Install it:
 bless([])->register('Content-disposition');
diff --git a/lib/MIME/Field/ContType.pm b/lib/MIME/Field/ContType.pm
index f8300e2..6053462 100644
--- a/lib/MIME/Field/ContType.pm
+++ b/lib/MIME/Field/ContType.pm
@@ -63,7 +63,7 @@ use vars qw($VERSION @ISA);
 @ISA = qw(MIME::Field::ParamVal);
 
 # The package version, both in 1.23 style *and* usable by MakeMaker:
-$VERSION = "5.505";
+$VERSION = "5.507";
 
 # Install it:
 bless([])->register('Content-type');
@@ -186,7 +186,7 @@ L<MIME::Field::ParamVal>, L<Mail::Field>
 =head1 AUTHOR
 
 Eryq (F<eryq at zeegee.com>), ZeeGee Software Inc (F<http://www.zeegee.com>).
-David F. Skoll (dfs at roaringpenguin.com) http://www.roaringpenguin.com
+Dianne Skoll (dfs at roaringpenguin.com) http://www.roaringpenguin.com
 
 =cut
 
diff --git a/lib/MIME/Field/ParamVal.pm b/lib/MIME/Field/ParamVal.pm
index 887f147..0827254 100644
--- a/lib/MIME/Field/ParamVal.pm
+++ b/lib/MIME/Field/ParamVal.pm
@@ -80,7 +80,7 @@ use MIME::Tools qw(:config :msgs);
 #------------------------------
 
 # The package version, both in 1.23 style *and* usable by MakeMaker:
-$VERSION = "5.505";
+$VERSION = "5.507";
 
 
 #------------------------------
@@ -238,11 +238,11 @@ sub parse_params {
     # Extract subsequent parameters.
     # No, we can't just "split" on semicolons: they're legal in quoted strings!
     while (1) {                     # keep chopping away until done...
-	$raw =~ m/\G$SPCZ(\;$SPCZ)+/og or last;             # skip leading separator
+	$raw =~ m/\G[^;]*(\;$SPCZ)+/og or last;             # skip leading separator
 	$raw =~ m/\G($PARAMNAME)\s*=\s*/og or last;      # give up if not a param
 	$param = lc($1);
-	$raw =~ m/\G(?:$QUOTED_STRING|($ENCTOKEN)|($BADTOKEN)|($TOKEN))/g or last;   # give up if no value"
-	my ($qstr, $enctoken, $badtoken, $token) = ($1, $2, $3, $4, $5);
+	$raw =~ m/\G(?:$QUOTED_STRING|($ENCTOKEN)|($TOKEN)|($BADTOKEN))/g or last;   # give up if no value"
+	my ($qstr, $enctoken, $token, $badtoken) = ($1, $2, $3, $4, $5);
 	if (defined($qstr)) {
             # unescape
 	    $qstr =~ s/\\(.)/$1/g;
@@ -251,6 +251,13 @@ sub parse_params {
 	    # Strip leading/trailing whitespace from badtoken
 	    $badtoken =~ s/^\s+//;
 	    $badtoken =~ s/\s+\z//;
+
+	    # Only keep token parameters in badtoken;
+	    # cut it off at the first non-token char.  CPAN RT #105455
+	    $badtoken =~ /^($TOKEN)*/;
+	    $badtoken = $1;
+	    # Cut it off at first whitespace too
+	    $badtoken =~ s/\s.*//;
 	}
 	$val = defined($qstr) ? $qstr :
 	    (defined($enctoken) ? $enctoken :
diff --git a/lib/MIME/Head.pm b/lib/MIME/Head.pm
index 76583a4..35b1f07 100644
--- a/lib/MIME/Head.pm
+++ b/lib/MIME/Head.pm
@@ -138,7 +138,7 @@ use MIME::Field::ContType;
 #------------------------------
 
 ### The package version, both in 1.23 style *and* usable by MakeMaker:
-$VERSION = "5.505";
+$VERSION = "5.507";
 
 ### Sanity (we put this test after our own version, for CPAN::):
 use Mail::Header 1.06 ();
@@ -912,7 +912,7 @@ L<Mail::Header>, L<Mail::Field>, L<MIME::Words>, L<MIME::Tools>
 =head1 AUTHOR
 
 Eryq (F<eryq at zeegee.com>), ZeeGee Software Inc (F<http://www.zeegee.com>).
-David F. Skoll (dfs at roaringpenguin.com) http://www.roaringpenguin.com
+Dianne Skoll (dfs at roaringpenguin.com) http://www.roaringpenguin.com
 
 All rights reserved.  This program is free software; you can redistribute
 it and/or modify it under the same terms as Perl itself.
diff --git a/lib/MIME/Parser.pm b/lib/MIME/Parser.pm
index fdd24bd..e714025 100644
--- a/lib/MIME/Parser.pm
+++ b/lib/MIME/Parser.pm
@@ -153,7 +153,7 @@ use MIME::Parser::Results;
 #------------------------------
 
 ### The package version, both in 1.23 style *and* usable by MakeMaker:
-$VERSION = "5.505";
+$VERSION = "5.507";
 
 ### How to catenate:
 $CAT = '/bin/cat';
@@ -1993,7 +1993,7 @@ L<MIME::Tools>, L<MIME::Head>, L<MIME::Body>, L<MIME::Entity>, L<MIME::Decoder>
 =head1 AUTHOR
 
 Eryq (F<eryq at zeegee.com>), ZeeGee Software Inc (F<http://www.zeegee.com>).
-David F. Skoll (dfs at roaringpenguin.com) http://www.roaringpenguin.com
+Dianne Skoll (dfs at roaringpenguin.com) http://www.roaringpenguin.com
 
 All rights reserved.  This program is free software; you can redistribute
 it and/or modify it under the same terms as Perl itself.
diff --git a/lib/MIME/Parser/Reader.pm b/lib/MIME/Parser/Reader.pm
index a7eaf5c..bf95aa3 100644
--- a/lib/MIME/Parser/Reader.pm
+++ b/lib/MIME/Parser/Reader.pm
@@ -241,7 +241,7 @@ sub read_chunk {
 	if ($n_out) {            ### native input, native output [fastest]
 	    while (<$n_in>) {
 		# Normalize line ending
-		$_ =~ s/(:?\n\r|\r\n|\r)$/\n/ if $normalize_newlines;
+		$_ =~ s/(?:\n\r|\r\n|\r)$/\n/ if $normalize_newlines;
 		if (substr($_, 0, 2) eq '--') {
 		    ($maybe = $_) =~ s/[ \t\r\n]+\Z//;
 		    $bh{$maybe} and do { $eos = $bh{$maybe}; last };
@@ -253,7 +253,7 @@ sub read_chunk {
 	else {                   ### native input, OO output [slower]
 	    while (<$n_in>) {
 		# Normalize line ending
-		$_ =~ s/(:?\n\r|\r\n|\r)$/\n/ if $normalize_newlines;
+		$_ =~ s/(?:\n\r|\r\n|\r)$/\n/ if $normalize_newlines;
 		if (substr($_, 0, 2) eq '--') {
 		    ($maybe = $_) =~ s/[ \t\r\n]+\Z//;
 		    $bh{$maybe} and do { $eos = $bh{$maybe}; last };
@@ -267,7 +267,7 @@ sub read_chunk {
 	if ($n_out) {            ### OO input, native output [even slower]
 	    while (defined($_ = $in->getline)) {
 		# Normalize line ending
-		$_ =~ s/(:?\n\r|\r\n|\r)$/\n/ if $normalize_newlines;
+		$_ =~ s/(?:\n\r|\r\n|\r)$/\n/ if $normalize_newlines;
 		if (substr($_, 0, 2) eq '--') {
 		    ($maybe = $_) =~ s/[ \t\r\n]+\Z//;
 		    $bh{$maybe} and do { $eos = $bh{$maybe}; last };
@@ -279,7 +279,7 @@ sub read_chunk {
 	else {                   ### OO input, OO output [slowest]
 	    while (defined($_ = $in->getline)) {
 		# Normalize line ending
-		$_ =~ s/(:?\n\r|\r\n|\r)$/\n/ if $normalize_newlines;
+		$_ =~ s/(?:\n\r|\r\n|\r)$/\n/ if $normalize_newlines;
 		if (substr($_, 0, 2) eq '--') {
 		    ($maybe = $_) =~ s/[ \t\r\n]+\Z//;
 		    $bh{$maybe} and do { $eos = $bh{$maybe}; last };
diff --git a/lib/MIME/Tools.pm b/lib/MIME/Tools.pm
index 6889144..ec6fab7 100644
--- a/lib/MIME/Tools.pm
+++ b/lib/MIME/Tools.pm
@@ -28,7 +28,7 @@ $ME = "MIME-tools";
 Exporter::export_ok_tags('config', 'msgs', 'msgtypes', 'utils');
 
 # The TOOLKIT version, both in 1.23 style *and* usable by MakeMaker:
-$VERSION = "5.505";
+$VERSION = "5.507";
 
 # Configuration (do NOT alter this directly)...
 # All legal CONFIG vars *must* be in here, even if only to be set to undef:
@@ -988,7 +988,7 @@ See ChangeLog file for full details.
 =head1 AUTHOR
 
 Eryq (F<eryq at zeegee.com>), ZeeGee Software Inc (F<http://www.zeegee.com>).
-David F. Skoll (F<dfs at roaringpenguin.com>) F<http://www.roaringpenguin.com>.
+Dianne Skoll (F<dfs at roaringpenguin.com>) F<http://www.roaringpenguin.com>.
 
 Copyright (c) 1998, 1999 by ZeeGee Software Inc (www.zeegee.com).
 Copyright (c) 2004 by Roaring Penguin Software Inc (www.roaringpenguin.com)
diff --git a/lib/MIME/WordDecoder.pm b/lib/MIME/WordDecoder.pm
index 6a5044c..fc13cf6 100644
--- a/lib/MIME/WordDecoder.pm
+++ b/lib/MIME/WordDecoder.pm
@@ -654,7 +654,7 @@ L<MIME::Tools>
 =head1 AUTHOR
 
 Eryq (F<eryq at zeegee.com>), ZeeGee Software Inc (F<http://www.zeegee.com>).
-David F. Skoll (dfs at roaringpenguin.com) http://www.roaringpenguin.com
+Dianne Skoll (dfs at roaringpenguin.com) http://www.roaringpenguin.com
 
 =cut
 
diff --git a/lib/MIME/Words.pm b/lib/MIME/Words.pm
index 3bb638b..04962f6 100644
--- a/lib/MIME/Words.pm
+++ b/lib/MIME/Words.pm
@@ -94,7 +94,7 @@ use MIME::QuotedPrint;
 #------------------------------
 
 ### The package version, both in 1.23 style *and* usable by MakeMaker:
-$VERSION = "5.505";
+$VERSION = "5.507";
 
 ### Nonprintables (controls + x7F + 8bit):
 my $NONPRINT = "\\x00-\\x1F\\x7F-\\xFF";
@@ -338,7 +338,7 @@ MIME::Base64 and MIME::QuotedPrint.
 =head1 AUTHOR
 
 Eryq (F<eryq at zeegee.com>), ZeeGee Software Inc (F<http://www.zeegee.com>).
-David F. Skoll (dfs at roaringpenguin.com) http://www.roaringpenguin.com
+Dianne Skoll (dfs at roaringpenguin.com) http://www.roaringpenguin.com
 
 All rights reserved.  This program is free software; you can redistribute
 it and/or modify it under the same terms as Perl itself.
diff --git a/t/Entity.t b/t/Entity.t
index 2ef11e2..421af5d 100644
--- a/t/Entity.t
+++ b/t/Entity.t
@@ -1,7 +1,7 @@
 #!/usr/bin/perl -w
 use strict;
 use warnings;
-use Test::More tests => 34;
+use Test::More tests => 39;
 
 use MIME::Entity;
 use MIME::Parser;
@@ -101,6 +101,45 @@ my $LINE;
      my $got = $e->head->mime_attr('content-type.charset');
      is($got, 'iso8859-1', 'Charset: explicit');
  }
+
+ {
+     #-----test------
+     my $croaked = 1;
+     eval {
+	     my $e = MIME::Entity->build(Type => 'message/rfc822',
+					 Encoding => 'base64',
+					 Data => "Subject: phooey\n\nBlat\n");
+	     $croaked = 0;
+     };
+     ok($croaked, 'MIME::Entity->build croaked on message/rfc822 with base64 encoding');
+     ok($@ =~ /can't have encoding base64 for message type message\/rfc822/,
+	'and it croaked with expected error.');
+ }
+
+ {
+     #-----test------
+     my $croaked = 1;
+     eval {
+	     my $e = MIME::Entity->build(Type => 'message/global',
+					 Encoding => 'base64',
+					 Data => "Subject: phooey\n\nBlat\n");
+	     $croaked = 0;
+     };
+     ok(!$croaked, 'MIME::Entity->build did not croak on message/global with base64 encoding');
+ }
+ {
+     #-----test------
+     my $croaked = 1;
+     eval {
+	     my $e = MIME::Entity->build(Type => 'multipart/ALTERNATIVE',
+					 Encoding => 'base64',
+					 Data => "Subject: phooey\n\nBlat\n");
+	     $croaked = 0;
+     };
+     ok($croaked, 'MIME::Entity->build croaked on multipart/alternative with base64 encoding');
+     ok($@ =~ /can't have encoding base64 for message type multipart\/ALTERNATIVE/,
+	'and it croaked with expected error.');
+ }
 }
 
 #diag("Create an entity");
diff --git a/t/ParamVal.t b/t/ParamVal.t
index 824cd38..94251ed 100644
--- a/t/ParamVal.t
+++ b/t/ParamVal.t
@@ -1,6 +1,6 @@
 use strict;
 use warnings;
-use Test::More tests => 5;
+use Test::More tests => 13;
 
 use MIME::Field::ContType;
 use MIME::WordDecoder;
@@ -34,3 +34,29 @@ use Encode;
 
 	is( encode('utf8', $wd->decode($field->param('answer'))), $expected, 'answer param was unpacked correctly');
 }
+
+# Test for CPAN RT #105455
+{
+	my $header = 'attachment; filename=wookie.zip size=3; junk=cabbage';
+
+	my $field = Mail::Field->new('Content-type');
+	$field->parse( $header );
+	is( $field->param('_'), 'attachment', 'Got body of header');
+	is ($field->param('filename'), 'wookie.zip', 'Got correct filename');
+	is ($field->param('junk'), 'cabbage', 'Got correct final param');
+
+	$header = 'attachment; filename="wookie.zip size=3"';
+
+	$field = Mail::Field->new('Content-type');
+	$field->parse( $header );
+	is( $field->param('_'), 'attachment', 'Got body of header');
+	is ($field->param('filename'), 'wookie.zip size=3', 'Got correct filename');
+
+	$header = 'attachment; filename="wookie.zip;x=1"; (crap); (more_crap) adhesive=glueme';
+
+	$field = Mail::Field->new('Content-type');
+	$field->parse( $header );
+	is( $field->param('_'), 'attachment', 'Got body of header');
+	is ($field->param('filename'), 'wookie.zip;x=1', 'Got correct filename');
+	is ($field->param('adhesive'), 'glueme', 'Got correct final parameter');
+}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libmime-tools-perl.git



More information about the Pkg-perl-cvs-commits mailing list