Skip to content

Commit

Permalink
RT#113960: perl5db should ignore /dev/tty on non-Unix systems
Browse files Browse the repository at this point in the history
If a Win32 system happens to have a \dev\tty file at the root of the current
drive, we were incorrectly treating that as an indicator that the system is
in fact Unix-like.

Fix this by looking at the filesystem for that file only after considering
all the OS platforms that we know aren't Unix-like in that way.
  • Loading branch information
jkeenan authored and arc committed Jan 4, 2017
1 parent 8235b1c commit f1cba94
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions lib/perl5db.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1533,14 +1533,6 @@ sub _autoflush {
undef $console;
}

=item * Unix - use F</dev/tty>.
=cut

elsif ( -e "/dev/tty" ) {
$console = "/dev/tty";
}

=item * Windows or MSDOS - use C<con>.
=cut
Expand All @@ -1565,6 +1557,17 @@ sub _autoflush {
$console = 'sys$command';
}

# Keep this penultimate, on the grounds that it satisfies a wide variety of
# Unix-like systems that would otherwise need to be identified individually.

=item * Unix - use F</dev/tty>.
=cut

elsif ( -e "/dev/tty" ) {
$console = "/dev/tty";
}

# Keep this last.

else {
Expand Down

0 comments on commit f1cba94

Please sign in to comment.