From d763d2f9644a1e6c335c5bcea633aa24e268d038 Mon Sep 17 00:00:00 2001 From: James E Keenan Date: Thu, 31 Aug 2017 22:57:06 -0400 Subject: [PATCH] Revert to 2-arg open in one case. If /dev/tty is inaccessible, redirecting file handles to STDERR: open (my $fh, ">&STDERR)) ... cannot be done as a 3 arg open or it'll actually try to write to that file. Bump $Term::ReadLine::VERSION. For: RT #132008 --- dist/Term-ReadLine/lib/Term/ReadLine.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dist/Term-ReadLine/lib/Term/ReadLine.pm b/dist/Term-ReadLine/lib/Term/ReadLine.pm index 88d5a758775f..e0f4e1beeb63 100644 --- a/dist/Term-ReadLine/lib/Term/ReadLine.pm +++ b/dist/Term-ReadLine/lib/Term/ReadLine.pm @@ -267,10 +267,13 @@ sub new { my($console, $consoleOUT) = $_[0]->findConsole; + + # the Windows CONIN$ needs GENERIC_WRITE mode to allow # a SetConsoleMode() if we end up using Term::ReadKey open FIN, (( $^O eq 'MSWin32' && $console eq 'CONIN$' ) ? '+<' : '<' ), $console; - open FOUT,'>', $consoleOUT; + # RT #132008: Still need 2-arg open here + open FOUT,">$consoleOUT"; #OUT->autoflush(1); # Conflicts with debugger? my $sel = select(FOUT); @@ -319,7 +322,7 @@ sub Features { \%features } package Term::ReadLine; # So late to allow the above code be defined? -our $VERSION = '1.16'; +our $VERSION = '1.17'; my ($which) = exists $ENV{PERL_RL} ? split /\s+/, $ENV{PERL_RL} : undef; if ($which) {