diff options
Diffstat (limited to 'contrib/bmake')
-rw-r--r-- | contrib/bmake/parse.c | 10 |
1 files changed, 10 insertions, 0 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 |