- make getservbyname on windows behaves like *nux when proto is an empty string

This commit is contained in:
Pierre Joye 2010-01-24 13:36:08 +00:00
parent 6a7d96eef9
commit f386e268cd

View File

@ -5582,6 +5582,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) {