diff options
author | hexcoder <heiko.eissfeldt@hexco.de> | 2013-06-03 18:33:12 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2013-06-03 20:30:28 -0700 |
commit | f2734596ace65fd02d5f61a5133acee6b4cce927 (patch) | |
tree | 71b02d95befc1a18bc9904a84038622d60eca602 | |
parent | 81db44398a49c2d50e2ae91383f44cdd1373776f (diff) | |
download | perl-f2734596ace65fd02d5f61a5133acee6b4cce927.tar.gz |
[perl #117311] B::Deparse with option -l leaves formfeed characters in its output
-rw-r--r-- | dist/B-Deparse/Deparse.pm | 3 | ||||
-rw-r--r-- | dist/B-Deparse/t/deparse.t | 10 |
2 files changed, 13 insertions, 0 deletions
diff --git a/dist/B-Deparse/Deparse.pm b/dist/B-Deparse/Deparse.pm index e50ea066d4..b62976d054 100644 --- a/dist/B-Deparse/Deparse.pm +++ b/dist/B-Deparse/Deparse.pm @@ -972,6 +972,9 @@ sub indent { } $line = substr($line, 1); } + if (index($line, "\f") > 0) { + $line =~ s/\f/\n/; + } if (substr($line, 0, 1) eq "\f") { $line = substr($line, 1); # no indent } else { diff --git a/dist/B-Deparse/t/deparse.t b/dist/B-Deparse/t/deparse.t index eb87bfd374..daa611d61f 100644 --- a/dist/B-Deparse/t/deparse.t +++ b/dist/B-Deparse/t/deparse.t @@ -185,6 +185,16 @@ sub :::::: { } EOCODG +# [perl #117311] +$a = `$^X $path "-MO=Deparse,-l" -e "map{ eval(0) }()" 2>&1`; +$a =~ s/-e syntax OK\n//g; +is($a, <<'EOCODH', "[perl #117311] [PATCH] -l option ('#line ...') does not emit ^Ls in the output"); +#line 1 "-e" +map { +#line 1 "-e" +eval 0;} (); +EOCODH + # [perl #33752] { my $code = <<"EOCODE"; |