diff options
author | Shlomi Fish <shlomif@shlomifish.org> | 2013-08-10 10:21:16 +0300 |
---|---|---|
committer | James E Keenan <jkeenan@cpan.org> | 2013-08-10 15:27:31 +0200 |
commit | aa8c2dcb5a098416ce30bf30f65ded786b2f7b65 (patch) | |
tree | a2b101fa008fbdbcb3f0c8a79bb02e1d983dc091 /lib | |
parent | 8e15b5447d0cc1a5b3b30bff36c58e5d33963562 (diff) | |
download | perl-aa8c2dcb5a098416ce30bf30f65ded786b2f7b65.tar.gz |
Fix RT #41461 (with a test).
A problem with the perl debugger of writing to an undef $LINEINFO.
Bump $VERSION to 1.42.
For: RT #41461
Diffstat (limited to 'lib')
-rw-r--r-- | lib/perl5db.pl | 8 | ||||
-rw-r--r-- | lib/perl5db.t | 10 |
2 files changed, 15 insertions, 3 deletions
diff --git a/lib/perl5db.pl b/lib/perl5db.pl index 48ec301e3f..ab82616dfe 100644 --- a/lib/perl5db.pl +++ b/lib/perl5db.pl @@ -523,7 +523,7 @@ BEGIN { # Debugger for Perl 5.00x; perl5db.pl patch level: use vars qw($VERSION $header); -$VERSION = '1.41'; +$VERSION = '1.42'; $header = "perl5db.pl version $VERSION"; @@ -6143,7 +6143,11 @@ sub print_lineinfo { resetterm(1) if $LINEINFO eq $OUT and $term_pid != $$; local $\ = ''; local $, = ''; - print $LINEINFO @_; + # $LINEINFO may be undef if $noTTY is set or some other issue. + if ($LINEINFO) + { + print {$LINEINFO} @_; + } } ## end sub print_lineinfo =head2 C<postponed_sub> diff --git a/lib/perl5db.t b/lib/perl5db.t index 26b0581c89..09a86552f8 100644 --- a/lib/perl5db.t +++ b/lib/perl5db.t @@ -29,7 +29,7 @@ BEGIN { $ENV{PERL_RL} = 'Perl'; # Suppress system Term::ReadLine::Gnu } -plan(117); +plan(119); my $rc_filename = '.perldb'; @@ -108,6 +108,14 @@ EOF is( $?, 0, '[perl #116771] autotrace does not crash debugger, exit == 0' ); like( $output, 'success' , '[perl #116771] code is run' ); } +# [ perl #41461] Frame=2 noTTY +{ + local $ENV{PERLDB_OPTS} = "frame=2 noTTY nonstop"; + rc(''); + my $output = runperl( switches => [ '-d' ], prog => 'print q{success}' ); + is( $?, 0, '[perl #41461] frame=2 noTTY does not crash debugger, exit == 0' ); + like( $output, 'success' , '[perl #41461] code is run' ); +} { rc(<<'EOF'); |