Re: [PATCH 2/5] Don't return 'undef' in case called in a vector context.
- From
- Dan Zwell <dzwell@gmail.com>
- Date
- Nov 23, 2007, 04:15 UTC
- Message-ID
- <474653F6.2060803@zwell.net>
- In-Reply-To
- <7vd4u23rpg.fsf@gitster.siamese.dyndns.org>
Junio C Hamano wrote:
Show 18 quoted lines
> Dan Zwell <dzwell@zwell.net> writes:
>
>> diff --git a/perl/Git.pm b/perl/Git.pm
>> index dca92c8..6603762 100644
>> --- a/perl/Git.pm
>> +++ b/perl/Git.pm
>> @@ -508,7 +508,7 @@ sub config {
>> my $E = shift;
>> if ($E->value() == 1) {
>> # Key not found.
>> - return undef;
>> + return;
>> } else {
>> throw $E;
>> }
>
> Shouldn't the same fix made to config_bool as well?
> I didn't realize it at the time, but yes, config_bool needs this (though the only time config_bool is evaluated in a list context should be when it is evaluated as an argument to another function). I'll make the change.
Dan