All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH v2 3/3] gitweb/gitweb.perl: don't call S_ISREG() with undef
Date: Sat, 19 Feb 2011 16:57:02 +0100	[thread overview]
Message-ID: <201102191657.02431.jnareb@gmail.com> (raw)
In-Reply-To: <1298129262-10468-4-git-send-email-avarab@gmail.com>

On Sat, 19 Feb 2011, Ævar Arnfjörð Bjarmason wrote:

> Change S_ISREG($to_mode_oct) to S_ISREG($from_mode_oct) in the branch
> that handles from modes, not to modes. This logic appears to have been
> caused by copy/paste programming by Jakub Narebski in e8e41a93. It
> would be better to rewrite this code not to be duplicated, but I
> haven't done so.
> 
> This issue caused a failing test on perl 5.13.9, which has a warning
> that turned this up:
> 
>      gitweb.perl: Use of uninitialized value in subroutine entry at /home/avar/g/git/t/../gitweb/gitweb.perl line 4415.

[...]
> Reported-by: perl 5.13.9
> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>

Thanks for catching this.  I wonder why we didn't caught this earlier...


For what it is worth it:

Acked-by: Jakub Narebski <jnareb@gmail.com>

> ---
>  gitweb/gitweb.perl |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
> index b02372c..1b9369d 100755
> --- a/gitweb/gitweb.perl
> +++ b/gitweb/gitweb.perl
> @@ -4412,7 +4412,7 @@ sub git_difftree_body {
>  		}
>  		if ($diff->{'from_mode'} ne ('0' x 6)) {
>  			$from_mode_oct = oct $diff->{'from_mode'};
> -			if (S_ISREG($to_mode_oct)) { # only for regular file
> +			if (S_ISREG($from_mode_oct)) { # only for regular file
>  				$from_mode_str = sprintf("%04o", $from_mode_oct & 0777); # permission bits
>  			}
>  			$from_file_type = file_type($diff->{'from_mode'});
> -- 
> 1.7.2.3
> 
> 

-- 
Jakub Narebski
Poland

      reply	other threads:[~2011-02-19 16:05 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-19 14:10 [PATCH] gitweb/gitweb.perl: remove use of qw(...) as parentheses Ævar Arnfjörð Bjarmason
2011-02-19 15:27 ` [PATCH v2 0/3] Fix failure-causing warnings in Gitweb + improve gitweb-lib.sh Ævar Arnfjörð Bjarmason
2011-02-19 15:27 ` [PATCH v2 1/3] t/gitweb-lib.sh: print to stderr when gitweb_run has errors Ævar Arnfjörð Bjarmason
2011-02-19 15:46   ` Jakub Narebski
2011-02-19 16:17     ` Ævar Arnfjörð Bjarmason
2011-02-19 18:16       ` Jakub Narebski
2011-02-19 19:11         ` Ævar Arnfjörð Bjarmason
2011-02-21  6:40         ` Junio C Hamano
2011-02-19 15:27 ` [PATCH v2 2/3] gitweb/gitweb.perl: remove use of qw(...) as parentheses Ævar Arnfjörð Bjarmason
2011-02-19 15:54   ` Jakub Narebski
2011-02-19 16:02     ` Jakub Narebski
2011-02-19 16:06     ` Ævar Arnfjörð Bjarmason
2011-02-20 14:42       ` Jakub Narebski
2011-02-19 15:27 ` [PATCH v2 3/3] gitweb/gitweb.perl: don't call S_ISREG() with undef Ævar Arnfjörð Bjarmason
2011-02-19 15:57   ` Jakub Narebski [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201102191657.02431.jnareb@gmail.com \
    --to=jnareb@gmail.com \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.