aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon J. Gerraty <sjg@FreeBSD.org>2013-08-10 21:31:35 +0000
committerSimon J. Gerraty <sjg@FreeBSD.org>2013-08-10 21:31:35 +0000
commit84efbe96f11d9de368c625f19224763ab4e6f0c1 (patch)
tree394ca330f5d8ecccf6fd2cb13b9031696509a049
parent1f039bded4e0c04ef1f2200d8acc41332370ed23 (diff)
downloadsrc-84efbe96f11d9de368c625f19224763ab4e6f0c1.tar.gz
src-84efbe96f11d9de368c625f19224763ab4e6f0c1.zip
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.
Notes
Notes: svn path=/head/; revision=254194
-rw-r--r--contrib/bmake/parse.c10
-rw-r--r--usr.bin/bmake/Makefile2
2 files changed, 11 insertions, 1 deletions
diff --git a/contrib/bmake/parse.c b/contrib/bmake/parse.c
index 928ff4aa2930..5096767958a4 100644
--- a/contrib/bmake/parse.c
+++ b/contrib/bmake/parse.c
@@ -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
diff --git a/usr.bin/bmake/Makefile b/usr.bin/bmake/Makefile
index 86414d43e904..f7c403caa482 100644
--- a/usr.bin/bmake/Makefile
+++ b/usr.bin/bmake/Makefile
@@ -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}