From: Pierre Joye Date: Sun, 24 Jan 2010 13:36:08 +0000 (+0000) Subject: - make getservbyname on windows behaves like *nux when proto is an empty string X-Git-Tag: php-5.4.0alpha1~191^2~2050 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=36a0d2e5257f839d5205c8f8602d4ac47f865724;p=php - make getservbyname on windows behaves like *nux when proto is an empty string --- diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 5818d370de..270d0fb898 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -5661,6 +5661,15 @@ PHP_FUNCTION(getservbyname) return; } + +/* empty string behaves like NULL on windows implementation of + getservbyname. Let be portable instead. */ +#ifdef PHP_WIN32 + if (proto_len == 0) { + RETURN_FALSE; + } +#endif + serv = getservbyname(name, proto); if (serv == NULL) {