From owner-svn-src-head@FreeBSD.ORG Sat Aug 10 21:31:36 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2FC76EBD; Sat, 10 Aug 2013 21:31:36 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1C5172225; Sat, 10 Aug 2013 21:31:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7ALVZgA090923; Sat, 10 Aug 2013 21:31:35 GMT (envelope-from sjg@svn.freebsd.org) Received: (from sjg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7ALVZ9l090921; Sat, 10 Aug 2013 21:31:35 GMT (envelope-from sjg@svn.freebsd.org) Message-Id: <201308102131.r7ALVZ9l090921@svn.freebsd.org> From: "Simon J. Gerraty" Date: Sat, 10 Aug 2013 21:31:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254194 - in head: contrib/bmake usr.bin/bmake X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Aug 2013 21:31:36 -0000 Author: sjg Date: Sat Aug 10 21:31:35 2013 New Revision: 254194 URL: http://svnweb.freebsd.org/changeset/base/254194 Log: ParseGetLine: don't treat a zero byte as end of buffer if P_end says it isn't. Consume up to next newline, and issue a parse warning. If no newline found before P_end, carry on as before. Modified: head/contrib/bmake/parse.c head/usr.bin/bmake/Makefile Modified: head/contrib/bmake/parse.c ============================================================================== --- head/contrib/bmake/parse.c Sat Aug 10 21:13:18 2013 (r254193) +++ head/contrib/bmake/parse.c Sat Aug 10 21:31:35 2013 (r254194) @@ -2582,6 +2582,16 @@ ParseGetLine(int flags, int *length) if (cf->P_end == NULL) /* End of string (aka for loop) data */ break; + /* see if there is more we can parse */ + while (ptr++ < cf->P_end) { + if ((ch = *ptr) == '\n') { + if (ptr > line && ptr[-1] == '\\') + continue; + Parse_Error(PARSE_WARNING, + "Zero byte read from file, skipping rest of line."); + break; + } + } if (cf->nextbuf != NULL) { /* * End of this buffer; return EOF and outer logic Modified: head/usr.bin/bmake/Makefile ============================================================================== --- head/usr.bin/bmake/Makefile Sat Aug 10 21:13:18 2013 (r254193) +++ head/usr.bin/bmake/Makefile Sat Aug 10 21:31:35 2013 (r254194) @@ -17,7 +17,7 @@ CLEANFILES+= bootstrap # $Id: Makefile,v 1.17 2013/07/30 19:13:53 sjg Exp $ # Base version on src date -MAKE_VERSION= 20130730 +MAKE_VERSION= 20130810 PROG?= ${.CURDIR:T}