Subject: | MIME::Parser::Reader buggy regexp |
Date: | Wed, 07 Jan 2015 15:28:39 +0100 |
To: | bug-MIME-tools [...] rt.cpan.org |
From: | Torge Husfeldt <torge.husfeldt [...] 1und1.de> |
Hi,
I believe all instances of the following as bugs:
$_ =~ s/(:?\n\r|\r\n|\r)$/\n/ if $normalize_newlines;
^^^
I'm pretty sure this was meant to be a non-capturing, grouping regexp.
Yet it turns out to be a capturing regexp looking for an optional colon
in just one of the alternative newline-styles.
This error got copy-pasted to the following lines:
244: $_ =~ s/(:?\n\r|\r\n|\r)$/\n/ if $normalize_newlines;
256: $_ =~ s/(:?\n\r|\r\n|\r)$/\n/ if $normalize_newlines;
270: $_ =~ s/(:?\n\r|\r\n|\r)$/\n/ if $normalize_newlines;
282: $_ =~ s/(:?\n\r|\r\n|\r)$/\n/ if $normalize_newlines;
I found this in the latest source pulled right now from:
http://cpansearch.perl.org/src/DSKOLL/MIME-tools-5.505/lib/MIME/Parser/Reader.pm
but it is also present in:
This is perl 5, version 18, subversion 2 (v5.18.2) built for
x86_64-linux-gnu-thread-multi
(with 41 registered patches, see perl -V for more detail)
on:
Linux LXKA-G99G7W1 3.13.0-40-generic #69-Ubuntu SMP Thu Nov 13 17:53:56
UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
Proposed patch attached.
HTH
--
Torge Husfeldt
1&1 Internet Service GmbH | Brauerstraße 50 | 76135 Karlsruhe | Germany
Phone: +49 721 91374-4795
E-Mail: torge.husfeldt@1und1.de | Web: www.1und1.de
Hauptsitz Montabaur, Amtsgericht Montabaur, HRB 20141
Geschäftsführer: Frank Einhellinger, Uwe Lamnek, Jan Oetjen
Member of United Internet
Message body is not shown because sender requested not to inline it.