diff options
Diffstat (limited to 'src/lib/libc/net/getnetbyname.c')
| -rw-r--r-- | src/lib/libc/net/getnetbyname.c | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/src/lib/libc/net/getnetbyname.c b/src/lib/libc/net/getnetbyname.c index 93a2e1256c..04ab7b6332 100644 --- a/src/lib/libc/net/getnetbyname.c +++ b/src/lib/libc/net/getnetbyname.c | |||
| @@ -1,5 +1,3 @@ | |||
| 1 | /* $NetBSD: getnetbyname.c,v 1.4 1995/02/25 06:20:31 cgd Exp $ */ | ||
| 2 | |||
| 3 | /* | 1 | /* |
| 4 | * Copyright (c) 1983, 1993 | 2 | * Copyright (c) 1983, 1993 |
| 5 | * The Regents of the University of California. All rights reserved. | 3 | * The Regents of the University of California. All rights reserved. |
| @@ -12,11 +10,7 @@ | |||
| 12 | * 2. Redistributions in binary form must reproduce the above copyright | 10 | * 2. Redistributions in binary form must reproduce the above copyright |
| 13 | * notice, this list of conditions and the following disclaimer in the | 11 | * notice, this list of conditions and the following disclaimer in the |
| 14 | * documentation and/or other materials provided with the distribution. | 12 | * documentation and/or other materials provided with the distribution. |
| 15 | * 3. All advertising materials mentioning features or use of this software | 13 | * 3. Neither the name of the University nor the names of its contributors |
| 16 | * must display the following acknowledgement: | ||
| 17 | * This product includes software developed by the University of | ||
| 18 | * California, Berkeley and its contributors. | ||
| 19 | * 4. Neither the name of the University nor the names of its contributors | ||
| 20 | * may be used to endorse or promote products derived from this software | 14 | * may be used to endorse or promote products derived from this software |
| 21 | * without specific prior written permission. | 15 | * without specific prior written permission. |
| 22 | * | 16 | * |
| @@ -34,11 +28,7 @@ | |||
| 34 | */ | 28 | */ |
| 35 | 29 | ||
| 36 | #if defined(LIBC_SCCS) && !defined(lint) | 30 | #if defined(LIBC_SCCS) && !defined(lint) |
| 37 | #if 0 | 31 | static char rcsid[] = "$OpenBSD: getnetbyname.c,v 1.6 2003/06/02 20:18:35 millert Exp $"; |
| 38 | static char sccsid[] = "@(#)getnetbyname.c 8.1 (Berkeley) 6/4/93"; | ||
| 39 | #else | ||
| 40 | static char rcsid[] = "$NetBSD: getnetbyname.c,v 1.4 1995/02/25 06:20:31 cgd Exp $"; | ||
| 41 | #endif | ||
| 42 | #endif /* LIBC_SCCS and not lint */ | 32 | #endif /* LIBC_SCCS and not lint */ |
| 43 | 33 | ||
| 44 | #include <netdb.h> | 34 | #include <netdb.h> |
| @@ -47,18 +37,18 @@ static char rcsid[] = "$NetBSD: getnetbyname.c,v 1.4 1995/02/25 06:20:31 cgd Exp | |||
| 47 | extern int _net_stayopen; | 37 | extern int _net_stayopen; |
| 48 | 38 | ||
| 49 | struct netent * | 39 | struct netent * |
| 50 | getnetbyname(name) | 40 | _getnetbyname(name) |
| 51 | register const char *name; | 41 | register const char *name; |
| 52 | { | 42 | { |
| 53 | register struct netent *p; | 43 | register struct netent *p; |
| 54 | register char **cp; | 44 | register char **cp; |
| 55 | 45 | ||
| 56 | setnetent(_net_stayopen); | 46 | setnetent(_net_stayopen); |
| 57 | while (p = getnetent()) { | 47 | while ((p = getnetent())) { |
| 58 | if (strcmp(p->n_name, name) == 0) | 48 | if (strcasecmp(p->n_name, name) == 0) |
| 59 | break; | 49 | break; |
| 60 | for (cp = p->n_aliases; *cp != 0; cp++) | 50 | for (cp = p->n_aliases; *cp != 0; cp++) |
| 61 | if (strcmp(*cp, name) == 0) | 51 | if (strcasecmp(*cp, name) == 0) |
| 62 | goto found; | 52 | goto found; |
| 63 | } | 53 | } |
| 64 | found: | 54 | found: |
