/* Hosts file parser in nss_files module.
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
if (result->h_addrtype != ((_res.options & RES_USE_INET6)
? AF_INET6 : AF_INET))
continue;
- LOOKUP_NAME (h_name, h_aliases)
+ LOOKUP_NAME_CASE (h_name, h_aliases)
}, const char *name)
DB_LOOKUP (hostbyname2, ,,
{
if (result->h_addrtype != af)
continue;
- LOOKUP_NAME (h_name, h_aliases)
+ LOOKUP_NAME_CASE (h_name, h_aliases)
}, const char *name, int af)
DB_LOOKUP (hostbyaddr, ,,
#include "files-XXX.c"
DB_LOOKUP (netbyname, ,,
- LOOKUP_NAME (n_name, n_aliases),
+ LOOKUP_NAME_CASE (n_name, n_aliases),
const char *name)
DB_LOOKUP (netbyaddr, ,,
/* Common code for file-based database parsers in nss_files module.
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
break; \
}
+#define LOOKUP_NAME_CASE(nameelt, aliaselt) \
+{ \
+ char **ap; \
+ if (! __strcasecmp (name, result->nameelt)) \
+ break; \
+ for (ap = result->aliaselt; *ap; ++ap) \
+ if (! __strcasecmp (name, *ap)) \
+ break; \
+ if (*ap) \
+ break; \
+}
+
/* This is defined by db-*.c to include "../nss_db/db-XXX.c" instead. */
#ifndef GENERIC