Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-6]: src/lib/libc/net Pull up following revision(s) (requested by ...



details:   https://anonhg.NetBSD.org/src/rev/8b5eb571a126
branches:  netbsd-6
changeset: 777064:8b5eb571a126
user:      snj <snj%NetBSD.org@localhost>
date:      Tue Jun 21 19:39:25 2016 +0000

description:
Pull up following revision(s) (requested by buhrow in ticket #1085):
        src/lib/libc/net/gethnamaddr.c: patch
Fix parsing of /etc/hosts.  PR lib/48926.

diffstat:

 lib/libc/net/gethnamaddr.c |  11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diffs (32 lines):

diff -r ea91bf3c8f1d -r 8b5eb571a126 lib/libc/net/gethnamaddr.c
--- a/lib/libc/net/gethnamaddr.c        Wed May 18 10:53:20 2016 +0000
+++ b/lib/libc/net/gethnamaddr.c        Tue Jun 21 19:39:25 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gethnamaddr.c,v 1.77.4.2 2013/12/23 22:56:48 riz Exp $ */
+/*     $NetBSD: gethnamaddr.c,v 1.77.4.3 2016/06/21 19:39:25 snj Exp $ */
 
 /*
  * ++Copyright++ 1985, 1988, 1993
@@ -57,7 +57,7 @@
 static char sccsid[] = "@(#)gethostnamadr.c    8.1 (Berkeley) 6/4/93";
 static char rcsid[] = "Id: gethnamaddr.c,v 8.21 1997/06/01 20:34:37 vixie Exp ";
 #else
-__RCSID("$NetBSD: gethnamaddr.c,v 1.77.4.2 2013/12/23 22:56:48 riz Exp $");
+__RCSID("$NetBSD: gethnamaddr.c,v 1.77.4.3 2016/06/21 19:39:25 snj Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -742,10 +742,9 @@
                goto again;
        if (*p == '#')
                goto again;
-       p[llen] = '\0';
-       if (!(cp = strpbrk(p, "#\n")))
-               goto again;
-       *cp = '\0';
+       p[llen - 1] = '\0';
+       if ((cp = strpbrk(p, "#")) != NULL)
+               *cp = '\0';
        if (!(cp = strpbrk(p, " \t")))
                goto again;
        *cp++ = '\0';



Home | Main Index | Thread Index | Old Index