Permalink
Browse files

(RT #79891) Preserve indentation when a line is redacted into multipl…

…e lines.
  • Loading branch information...
1 parent 8b000e6 commit 96959f01fee1722be4281938dc53a62739209c3b @guillaumeaubert guillaumeaubert committed Sep 27, 2012
Showing with 6 additions and 0 deletions.
  1. +6 −0 lib/Carp/Parse/CallerInformation/Redacted.pm
@@ -127,6 +127,12 @@ sub get_redacted_line
$redacted_arguments_string = "($redacted_arguments_string)"
if scalar( @$redacted_arguments_list ) == 1;
+ # Data::Dump::dump() may format the output on more than one line.
+ # We make sure that the indentation of the original line is carried
+ # here to the new lines.
+ my ( $indentation ) = $line =~ /^(\s*)/;
+ $redacted_arguments_string =~ s/(\r?\n)/$1$indentation/gs;
+
$line =~ s/\(\Q$arguments_string\E\)/$redacted_arguments_string/x;
}

0 comments on commit 96959f0

Please sign in to comment.