From 773955959c2cdb872a39a4809fc07ccb5563a177 Mon Sep 17 00:00:00 2001 From: Simon Josefsson Date: Wed, 9 Oct 2024 14:53:47 +0200 Subject: Don't select(stdin) to decide pipe or call. Report by Arthur de Jong in https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=697475 --- git2cl | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'git2cl') diff --git a/git2cl b/git2cl index dcea523..2fb3290 100755 --- a/git2cl +++ b/git2cl @@ -92,13 +92,6 @@ my %month = ( my $fh = new FileHandle; -sub key_ready -{ - my ($rin, $nfd); - vec($rin, fileno(STDIN), 1) = 1; - return $nfd = select($rin, undef, undef, 0); -} - sub strptime { my $str = shift; return undef if not defined $str; @@ -323,9 +316,8 @@ $state = 0; # if reading from STDIN, we assume that we are # getting git log as input -if (key_ready()) +if (-f STDIN or -l STDIN or -p STDIN) { - #my $dummyfh; # don't care about writing #($fh,$dummyfh) = FileHandle::pipe; $fh->fdopen(*STDIN, 'r'); -- cgit v1.1