From owner-svn-src-stable-10@freebsd.org Fri Dec 4 09:25:14 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1C48A40082; Fri, 4 Dec 2015 09:25:14 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6FC301E18; Fri, 4 Dec 2015 09:25:14 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB49PDuq054555; Fri, 4 Dec 2015 09:25:13 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB49PDLS054554; Fri, 4 Dec 2015 09:25:13 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512040925.tB49PDLS054554@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 4 Dec 2015 09:25:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r291761 - stable/10/tools/regression/lib/libc/resolv X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Dec 2015 09:25:14 -0000 Author: ngie Date: Fri Dec 4 09:25:13 2015 New Revision: 291761 URL: https://svnweb.freebsd.org/changeset/base/291761 Log: MFC r291359,r291362: r291359: Skip over lines that start with # (comments) r291362: r291359 was incorrect. Skip over tokens that start with `#' as fgetln can return more than one '\n' delimited line in a buffer Handle empty lines too, just in case Modified: stable/10/tools/regression/lib/libc/resolv/resolv.c Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/regression/lib/libc/resolv/resolv.c ============================================================================== --- stable/10/tools/regression/lib/libc/resolv/resolv.c Fri Dec 4 09:18:59 2015 (r291760) +++ stable/10/tools/regression/lib/libc/resolv/resolv.c Fri Dec 4 09:25:13 2015 (r291761) @@ -90,8 +90,11 @@ load(const char *fname) char c = line[len]; char *ptr; line[len] = '\0'; - for (ptr = strtok(line, WS); ptr; ptr = strtok(NULL, WS)) + for (ptr = strtok(line, WS); ptr; ptr = strtok(NULL, WS)) { + if (ptr == '\0' || ptr[0] == '#') + continue; sl_add(hosts, strdup(ptr)); + } line[len] = c; }