From 2e9b8d76084ff062d037c322905c81cb157fbce6 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 4 Mar 1998 11:30:00 +0000 Subject: [PATCH] (__nss_lookup): Return 1 if this was the last module. --- nss/nsswitch.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/nss/nsswitch.c b/nss/nsswitch.c index ac7cc877e6e..f06a34bd5bc 100644 --- a/nss/nsswitch.c +++ b/nss/nsswitch.c @@ -107,7 +107,7 @@ __nss_database_lookup (const char *database, const char *alternate_name, *ni = entry->service; if (*ni == NULL && alternate_name != NULL) - /* We haven't found a an entry so far. Try to find it with + /* We haven't found an entry so far. Try to find it with the alternative name. */ for (entry = service_table->entry; entry != NULL; entry = entry->next) if (strcmp (alternate_name, entry->name) == 0) @@ -130,7 +130,8 @@ __nss_database_lookup (const char *database, const char *alternate_name, /* -1 == not found - 0 == adjusted for next function */ + 0 == adjusted for next function + 1 == finished */ int __nss_lookup (service_user **ni, const char *fct_name, void **fctp) { @@ -145,7 +146,7 @@ __nss_lookup (service_user **ni, const char *fct_name, void **fctp) *fctp = nss_lookup_function (*ni, fct_name); } - return *fctp != NULL ? 0 : -1; + return *fctp != NULL ? 0 : (*ni)->next == NULL ? 1 : -1; } -- 2.47.2