* [PATCH] send-email: squelch warning due to comparing undefined $_ to ""
@ 2008-02-20 5:55 Jay Soffian
2008-02-20 18:37 ` Junio C Hamano
0 siblings, 1 reply; 2+ messages in thread
From: Jay Soffian @ 2008-02-20 5:55 UTC (permalink / raw)
To: git; +Cc: Jay Soffian, Junio C Hamano
The check to see if initial_reply_to is defined was also comparing $_ to
"" for a reason I cannot ascertain (looking at the commit which made the
change didn't provide enlightenment), but if $_ is undefined, perl
generates a warning.
Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
---
Junio, the commit which introduced the change was yours, but I don't
see why you were comparing $_ to "".
http://repo.or.cz/w/git.git?a=commit;h=ace9c2a9dd7c9e54194998fc6b7c677dbb7d0902
git-send-email.perl | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/git-send-email.perl b/git-send-email.perl
index 59601e3..ccb87a2 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -475,7 +475,7 @@ if ($thread && !defined $initial_reply_to && $prompting) {
$initial_reply_to = $_;
}
-if (defined $initial_reply_to && $_ ne "") {
+if (defined $initial_reply_to) {
$initial_reply_to =~ s/^\s*<?/</;
$initial_reply_to =~ s/>?\s*$/>/;
}
--
1.5.4.2.208.gfb302
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] send-email: squelch warning due to comparing undefined $_ to ""
2008-02-20 5:55 [PATCH] send-email: squelch warning due to comparing undefined $_ to "" Jay Soffian
@ 2008-02-20 18:37 ` Junio C Hamano
0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2008-02-20 18:37 UTC (permalink / raw)
To: Jay Soffian; +Cc: git
Jay Soffian <jaysoffian@gmail.com> writes:
> The check to see if initial_reply_to is defined was also comparing $_ to
> "" for a reason I cannot ascertain (looking at the commit which made the
> change didn't provide enlightenment), but if $_ is undefined, perl
> generates a warning.
>
> Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
> ---
> Junio, the commit which introduced the change was yours, but I don't
> see why you were comparing $_ to "".
I think it was meant to check for $initial_reply_to being empty
(i.e. not compare $_ but the variable), but even if that is the
case I do not think the check would make a difference.
So the patch looks good. Thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-02-20 18:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-20 5:55 [PATCH] send-email: squelch warning due to comparing undefined $_ to "" Jay Soffian
2008-02-20 18:37 ` Junio C Hamano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).