summaryrefslogtreecommitdiffstats
path: root/usr.bin/make
diff options
context:
space:
mode:
authorharti <harti@FreeBSD.org>2004-07-22 11:12:01 +0000
committerharti <harti@FreeBSD.org>2004-07-22 11:12:01 +0000
commitf85b318ed67c86365b6627242dd1f5cf3196988b (patch)
tree76075c23d5f2e5f565b3c53273722b86789557e4 /usr.bin/make
parent374897f0ebb1f4e8f959d63a533a73560bb23e04 (diff)
downloadFreeBSD-src-f85b318ed67c86365b6627242dd1f5cf3196988b.zip
FreeBSD-src-f85b318ed67c86365b6627242dd1f5cf3196988b.tar.gz
Fix handling of comments on .elif lines. The patch given in a followup
to the PR failed, because the line skipping function is actually called from two places in the code to do quite different things (this should be two functions probably): in a false .if to skip to the next line beginning with a dot and to collect .for loops. In the seconds case we should not skip comments, because they are actually harder to handle than we need for the .if case and should defer this to the main code. PR: bin/25627 Submitted by: Seth Kingsley (original patch)
Diffstat (limited to 'usr.bin/make')
-rw-r--r--usr.bin/make/parse.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/usr.bin/make/parse.c b/usr.bin/make/parse.c
index e8a9935..9cbef99 100644
--- a/usr.bin/make/parse.c
+++ b/usr.bin/make/parse.c
@@ -2021,6 +2021,13 @@ ParseSkipLine(int skip, int keep_newline)
while (((c = ParseReadc()) != '\n' || lastc == '\\')
&& c != EOF) {
+ if (skip && c == '#' && lastc != '\\') {
+ /* let a comment be terminated even by an escaped \n.
+ * This is consistent to comment handling in ParseReadLine */
+ while ((c = ParseReadc()) != '\n' && c != EOF)
+ ;
+ break;
+ }
if (c == '\n') {
if (keep_newline)
Buf_AddByte(buf, (Byte)c);
OpenPOWER on IntegriCloud