git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] git-svn: avoid warning on undef readline()

From
EWEric 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;
Previous: Johannes SchindelinNext: Ævar Arnfjörð Bjarmason
Message 6 of 11 in “git 2.17.0: uninitialized value $rec in scalar chomp at ...Git.pm line 557”
  1. Joseph MingroneApr 6, 2018
  2. Johannes SchindelinApr 6, 2018
  3. Joseph MingroneApr 6, 2018
  4. git-svn: avoid warning on undef readline()Ævar Arnfjörð Bjarmason, Apr 6, 2018
  5. Johannes SchindelinApr 6, 2018
  6. Eric WongApr 6, 2018
  7. Ævar Arnfjörð BjarmasonApr 6, 2018
  8. Eric WongApr 6, 2018
  9. Ævar Arnfjörð BjarmasonApr 6, 2018
  10. Junio C HamanoApr 9, 2018
  11. brian m. carlsonApr 7, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.