develooper Front page | perl.perl5.changes | Postings from April 2008

Change 33771: [patch]perl5db.pl, perl5db.t - LINUX/UNIX/CYGWIN/VMS

From:
Rafael Garcia-Suarez
Date:
April 30, 2008 05:00
Subject:
Change 33771: [patch]perl5db.pl, perl5db.t - LINUX/UNIX/CYGWIN/VMS
Change 33771 by rgs@scipion on 2008/04/30 11:56:36

	Subject: [patch]perl5db.pl, perl5db.t - LINUX/UNIX/CYGWIN/VMS
	From: "John E. Malmberg" <wb8tyw@qsl.net>
	Date: Mon, 28 Apr 2008 00:39:16 -0500
	Message-id: <48156304.30201@qsl.net>

Affected files ...

... //depot/perl/lib/perl5db.pl#134 edit
... //depot/perl/lib/perl5db.t#6 edit

Differences ...

==== //depot/perl/lib/perl5db.pl#134 (text) ====
Index: perl/lib/perl5db.pl
--- perl/lib/perl5db.pl#133~33753~	2008-04-27 00:40:00.000000000 -0700
+++ perl/lib/perl5db.pl	2008-04-30 04:56:36.000000000 -0700
@@ -1363,7 +1363,9 @@
 # As noted, this test really doesn't check accurately that the debugger
 # is running at a terminal or not.
 
-if ( -e "/dev/tty" ) {                      # this is the wrong metric!
+my $dev_tty = '/dev/tty';
+   $dev_tty = 'TT:' if ($^O eq 'VMS');
+if ( -e $dev_tty ) {                      # this is the wrong metric!
     $rcfile = ".perldb";
 }
 else {
@@ -6100,6 +6102,16 @@
 
     $pidprompt = '';    # Shown anyway in titlebar
 
+    # We need $term defined or we can not switch to the newly created xterm
+    if ($tty ne '' && !defined $term) {
+        eval { require Term::ReadLine } or die $@;
+        if ( !$rl ) {
+            $term = new Term::ReadLine::Stub 'perldb', $IN, $OUT;
+        }
+        else {
+            $term = new Term::ReadLine 'perldb', $IN, $OUT;
+        }
+    }
     # There's our new TTY.
     return $tty;
 } ## end sub xterm_get_fork_TTY
@@ -6766,18 +6778,6 @@
 
 sub TTY {
 
-    # With VMS we can get here with $term undefined, so we do not
-    # switch to this terminal.  There may be a better place to make
-    # sure that $term is defined on VMS
-    if ( @_ and ($^O eq 'VMS') and !defined($term) ) {
-	eval { require Term::ReadLine } or die $@;
-        if ( !$rl ) {
-	    $term = new Term::ReadLine::Stub 'perldb', $IN, $OUT;
-	}
-	else {
-	    $term = new Term::ReadLine 'perldb', $IN, $OUT;
-	}
-    }
     if ( @_ and $term and $term->Features->{newTTY} ) {
 
         # This terminal supports switching to a new TTY.

==== //depot/perl/lib/perl5db.t#6 (text) ====
Index: perl/lib/perl5db.t
--- perl/lib/perl5db.t#5~31959~	2007-09-25 01:20:31.000000000 -0700
+++ perl/lib/perl5db.t	2008-04-30 04:56:36.000000000 -0700
@@ -14,8 +14,10 @@
 	print "1..0 # Skip: no /dev/null\n";
 	exit 0;
     }
-    if (!-c "/dev/tty") {
-	print "1..0 # Skip: no /dev/tty\n";
+my $dev_tty = '/dev/tty';
+   $dev_tty = 'TT:' if ($^O eq 'VMS');
+    if (!-c $dev_tty) {
+	print "1..0 # Skip: no $dev_tty\n";
 	exit 0;
     }
 }
End of Patch.



Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About