df0948
From 7cdc0cd3cf5f9fd6459daa746db8f647c14ef9fe Mon Sep 17 00:00:00 2001
df0948
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
df0948
Date: Thu, 11 May 2017 08:43:33 +0200
df0948
Subject: [PATCH] Upgrade to 1.42
df0948
MIME-Version: 1.0
df0948
Content-Type: text/plain; charset=UTF-8
df0948
Content-Transfer-Encoding: 8bit
df0948
df0948
Unbundled from perl-5.25.12.
df0948
df0948
Signed-off-by: Petr Písař <ppisar@redhat.com>
df0948
---
df0948
 lib/Carp.pm       |  6 +++---
df0948
 lib/Carp/Heavy.pm |  2 +-
df0948
 t/Carp.t          | 13 ++++++++++++-
df0948
 t/arg_string.t    | 10 +++++++++-
df0948
 4 files changed, 25 insertions(+), 6 deletions(-)
df0948
df0948
diff --git a/lib/Carp.pm b/lib/Carp.pm
df0948
index 92f8866..05052b9 100644
df0948
--- a/lib/Carp.pm
df0948
+++ b/lib/Carp.pm
df0948
@@ -87,7 +87,7 @@ BEGIN {
df0948
     }
df0948
 }
df0948
 
df0948
-our $VERSION = '1.40';
df0948
+our $VERSION = '1.42';
df0948
 $VERSION =~ tr/_//d;
df0948
 
df0948
 our $MaxEvalLen = 0;
df0948
@@ -474,7 +474,7 @@ sub ret_backtrace {
df0948
         eval {
df0948
             CORE::die;
df0948
         };
df0948
-        if($@ =~ /^Died at .*(, <.*?> line \d+).$/ ) {
df0948
+        if($@ =~ /^Died at .*(, <.*?> (?:line|chunk) \d+).$/ ) {
df0948
             $mess .= $1;
df0948
         }
df0948
     }
df0948
@@ -636,7 +636,7 @@ Carp - alternative warn and die for modules
df0948
 
df0948
     # cluck, longmess and shortmess not exported by default
df0948
     use Carp qw(cluck longmess shortmess);
df0948
-    cluck "This is how we got here!";
df0948
+    cluck "This is how we got here!"; # warn with stack backtrace
df0948
     $long_message   = longmess( "message from cluck() or confess()" );
df0948
     $short_message  = shortmess( "message from carp() or croak()" );
df0948
 
df0948
diff --git a/lib/Carp/Heavy.pm b/lib/Carp/Heavy.pm
df0948
index b05d758..f9c584a 100644
df0948
--- a/lib/Carp/Heavy.pm
df0948
+++ b/lib/Carp/Heavy.pm
df0948
@@ -2,7 +2,7 @@ package Carp::Heavy;
df0948
 
df0948
 use Carp ();
df0948
 
df0948
-our $VERSION = '1.40';
df0948
+our $VERSION = '1.42';
df0948
 $VERSION =~ tr/_//d;
df0948
 
df0948
 # Carp::Heavy was merged into Carp in version 1.12.  Any mismatched versions
df0948
diff --git a/t/Carp.t b/t/Carp.t
df0948
index 9ecdf88..65daed7 100644
df0948
--- a/t/Carp.t
df0948
+++ b/t/Carp.t
df0948
@@ -3,7 +3,7 @@ no warnings "once";
df0948
 use Config;
df0948
 
df0948
 use IPC::Open3 1.0103 qw(open3);
df0948
-use Test::More tests => 66;
df0948
+use Test::More tests => 67;
df0948
 
df0948
 sub runperl {
df0948
     my(%args) = @_;
df0948
@@ -442,6 +442,16 @@ $@ =~ s/\n.*//; # just check first line
df0948
 is $@, "heek at ".__FILE__." line ".(__LINE__-2).", <DATA> line 2.\n",
df0948
     'last handle line num is mentioned';
df0948
 
df0948
+# [cpan #100183]
df0948
+{
df0948
+    local $/ = \6;
df0948
+    <XD::DATA>;
df0948
+    eval { croak 'jeek' };
df0948
+    $@ =~ s/\n.*//; # just check first line
df0948
+    is $@, "jeek at ".__FILE__." line ".(__LINE__-2).", <DATA> chunk 3.\n",
df0948
+        'last handle chunk num is mentioned';
df0948
+}
df0948
+
df0948
 SKIP:
df0948
 {
df0948
     skip "IPC::Open3::open3 needs porting", 1 if $Is_VMS;
df0948
@@ -531,3 +541,4 @@ __DATA__
df0948
 1
df0948
 2
df0948
 3
df0948
+abcdefghijklmnopqrstuvwxyz
df0948
diff --git a/t/arg_string.t b/t/arg_string.t
df0948
index dbd2e6e..dc70f43 100644
df0948
--- a/t/arg_string.t
df0948
+++ b/t/arg_string.t
df0948
@@ -1,6 +1,8 @@
df0948
 use warnings;
df0948
 use strict;
df0948
 
df0948
+# confirm that stack args are displayed correctly by longmess()
df0948
+
df0948
 use Test::More tests => 32;
df0948
 
df0948
 use Carp ();
df0948
@@ -22,7 +24,13 @@ like lm(3), qr/main::lm\(3\)/;
df0948
 like lm(substr("3\x{2603}", 0, 1)), qr/main::lm\(3\)/;
df0948
 like lm(-3), qr/main::lm\(-3\)/;
df0948
 like lm(-3.5), qr/main::lm\(-3\.5\)/;
df0948
-like lm(-3.5e100), qr/main::lm\(-3\.5[eE]\+?100\)/;
df0948
+like lm(-3.5e30),
df0948
+            qr/main::lm\(
df0948
+              (
df0948
+                -3500000000000000000000000000000
df0948
+              | -3\.5[eE]\+?0?30
df0948
+              )
df0948
+              \) /x;
df0948
 like lm(""), qr/main::lm\(""\)/;
df0948
 like lm("foo"), qr/main::lm\("foo"\)/;
df0948
 like lm("a\$b\@c\\d\"e"), qr/main::lm\("a\\\$b\\\@c\\\\d\\\"e"\)/;
df0948
-- 
df0948
2.9.3
df0948