Great Circle Associates Majordomo-Workers
(September 1996)
 

Indexed By Date: [Previous] [Next] Indexed By Thread: [Previous] [Next]

Subject: Re: 1.94 beta 2 woes
From: Dave Wolfe <dwolfe @ risc . sps . mot . com>
Date: Wed, 25 Sep 1996 08:40:24 -0500 (CDT)
To: brian @ hyperreal . com (Brian Behlendorf)
Cc: majordomo-workers @ greatcircle . com (Majordomo developer's mailing list), tibbs @ hpc . uh . edu, rickf @ portal . ca, cwilson @ sgi . com
In-reply-to: <Pine.BSI.3.95.960924215847.16233A-100000@taz.hyperreal.com> from "Brian Behlendorf" at Sep 24, 96 10:03:51 pm
Reply-to: Dave Wolfe <david_wolfe @ risc . sps . mot . com>

[ Brian Behlendorf writes: ]
> 
> On Tue, 24 Sep 1996, Rick Franchuk wrote:
> > 
> > 1.94 beta 2 seems to have the odd problem or two. First one is in 
> > 'resend', where my machine barfed on a 'restrict_post' entry... a bit 
> > of debugging showed that the response coming from &check_sender was the 
> > first line of text from the message being sent, confusing the hell out 
> > of checks after it returned. Fixed by adding a set of ""'s to the 
> > returns of check_sender (diffs available upon request).
> 
> I can verify this bug exists with Perl 4.036 and MD 1.94b3. The
> fix recommended by Rick, which is exactly what I'm using too, is
> attached as a patch. I am not confident I understand why one needs to
> explicitly
> 
>   return "";
> 
> instead of just 
> 
>   return;
> 
> but it does seem ugly.  I haven't tested to see if Perl 5 works the same
> way, but I suspect that this hasn't been noticed if it was just a Perl 4
> issue...

It's a problem the code. Return is defined as 'return <list>'. There
is no alternate without the <list> operand. None of the documentation
details what is returned when no operand is specified, but I suspect it
simply returns the value of the last expression before the return.

If the return value from a subroutine is always discarded, then it
doesn't matter what is specified, if anything, as the operand of return.
In this case, however, the return value of check_sender() *is* used, but
in 2 instances no return value is specified, so it's not surprising that
garbage is returned.

The bottom line is that if one want's to return a null string, then
return a null string, but don't expect an unspecified return to be a
null string. Although the fix may be "ugly", it's correct. Do you like

    return ();

any better?

-- 
 Dave Wolfe    *Not a spokesman for Motorola*
 Motorola MMTG  6501 Wm. Cannon Dr. W. OE112  Austin  TX  78735-8598


References:
Indexed By Date Previous: Re: Majordomo 1.94 Beta 3, whee!!
From: "Steven K. Buehler" <skb@sbcomp.net>
Next: Re: Majordomo Bombing
From: John Orthoefer <jco@BBNPlanet.com>
Indexed By Thread Previous: Re: 1.94 beta 2 woes
From: Brian Behlendorf <brian@hyperreal.com>
Next: Re: 1.94 beta 2 woes
From: Brian Behlendorf <brian@hyperreal.com>

Google
 
Search Internet Search www.greatcircle.com