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