From 59c37b6b21d585e006fbf896f1a87c54eadbabbf Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 18 Mar 1997 04:22:18 +0000 Subject: (servbyname): Match any protocol if proto==NULL. --- nss/nss_files/files-service.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nss/nss_files/files-service.c b/nss/nss_files/files-service.c index 5fb38e2058..317b4fa9cc 100644 --- a/nss/nss_files/files-service.c +++ b/nss/nss_files/files-service.c @@ -41,8 +41,8 @@ LINE_PARSER DB_LOOKUP (servbyname, 1 + strlen (name), (".%s/%s", name, proto), { - /* Must match both protocol and name. */ - if (strcmp (result->s_proto, proto)) + /* Must match both protocol (if specified) and name. */ + if (proto != NULL && strcmp (result->s_proto, proto)) continue; LOOKUP_NAME (s_name, s_aliases) }, -- cgit v1.2.3-70-g09d2