diff options
author | sobomax <sobomax@FreeBSD.org> | 2005-01-03 11:07:45 +0000 |
---|---|---|
committer | sobomax <sobomax@FreeBSD.org> | 2005-01-03 11:07:45 +0000 |
commit | 742d1c9a2deef3e3a8c55e763a1e8c2e46b2becb (patch) | |
tree | 932dc5516fad9adc5c8df459d8e23846159bce61 /lib/libc/net/getprotoent.c | |
parent | 4bf9384dba041617b5b6f2757dd817023110f50f (diff) | |
download | FreeBSD-src-742d1c9a2deef3e3a8c55e763a1e8c2e46b2becb.zip FreeBSD-src-742d1c9a2deef3e3a8c55e763a1e8c2e46b2becb.tar.gz |
Don't ignore the last line of config file (/etc/hosts, /etc/services, etc)
which doesn't end in \n, since it may be very confusing. Also this should
increase consistency, since most other config files work just fine regardless
of the presence of traling \n in the last line.
MFC After: 2 weeks
Diffstat (limited to 'lib/libc/net/getprotoent.c')
-rw-r--r-- | lib/libc/net/getprotoent.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/libc/net/getprotoent.c b/lib/libc/net/getprotoent.c index c8f1ad4..e2d7a97 100644 --- a/lib/libc/net/getprotoent.c +++ b/lib/libc/net/getprotoent.c @@ -87,9 +87,8 @@ again: if (*p == '#') goto again; cp = strpbrk(p, "#\n"); - if (cp == NULL) - goto again; - *cp = '\0'; + if (cp != NULL) + *cp = '\0'; proto.p_name = p; cp = strpbrk(p, " \t"); if (cp == NULL) |