From: Slaven Rezic Date: Sun, 8 Dec 2002 01:54:37 +0000 (+0100) Subject: getservbyport() should accept an empty string as its X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2b872ccad44e83808aafa1913f65a140f4c316a7;p=p5sagit%2Fp5-mst-13.2.git getservbyport() should accept an empty string as its proto argument (as does getservbyname()). Subject: Re: Is this a bug or am I being stupid? Message-ID: <87znrhl48i.fsf@vran.herceg.de> p4raw-id: //depot/perl@18262 --- diff --git a/pp_sys.c b/pp_sys.c index f1eb1b9..472f041 100644 --- a/pp_sys.c +++ b/pp_sys.c @@ -4952,6 +4952,9 @@ PP(pp_gservent) char *proto = POPpbytex; unsigned short port = (unsigned short)POPu; + if (proto && !*proto) + proto = Nullch; + #ifdef HAS_HTONS port = PerlSock_htons(port); #endif