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/getservent.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/getservent.c')
-rw-r--r-- | lib/libc/net/getservent.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/libc/net/getservent.c b/lib/libc/net/getservent.c index a89bc51..7e44235 100644 --- a/lib/libc/net/getservent.c +++ b/lib/libc/net/getservent.c @@ -244,9 +244,8 @@ unpack: if (*p == '#') goto again; cp = strpbrk(p, "#\n"); - if (cp == NULL) - goto again; - *cp = '\0'; + if (cp != NULL) + *cp = '\0'; serv.s_name = p; p = strpbrk(p, " \t"); if (p == NULL) |