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