]> granicus.if.org Git - php/commitdiff
- make getservbyname on windows behaves like *nux when proto is an empty string
authorPierre Joye <pajoye@php.net>
Sun, 24 Jan 2010 13:36:08 +0000 (13:36 +0000)
committerPierre Joye <pajoye@php.net>
Sun, 24 Jan 2010 13:36:08 +0000 (13:36 +0000)
ext/standard/basic_functions.c

index 78ce124d662125d1b7a15edd18f737c80321fc5d..33ca9b7e1c18d1b7c25d0819785b65371cb8c71a 100644 (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) {