Re: [PATCH] git-svn: avoid warning on undef readline()
- From
- Eric Wong <e@80x24.org>
- Date
- Apr 6, 2018, 16:56 UTC
- Message-ID
- <20180406165618.GA6367@80x24.org>
- In-Reply-To
- <20180406131514.740-1-avarab@gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:
> See https://public-inbox.org/git/86h8oobl36.fsf@phe.ftfl.ca/ for the > original report.
Thanks for taking a look at this. Also https://bugs.debian.org/894997
Show 8 quoted lines
> --- a/perl/Git.pm
> +++ b/perl/Git.pm
> @@ -554,7 +554,7 @@ sub get_record {
> my ($fh, $rs) = @_;
> local $/ = $rs;
> my $rec = <$fh>;
> - chomp $rec if defined $rs;
> + chomp $rec if defined $rs and defined $rec;I'm struggling to understand the reason for the "defined $rs" check. I think it was a braino on my part and meant to use:
chomp $rec if defined $rec;