summaryrefslogtreecommitdiffstats
path: root/usr.bin/make
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/make')
-rw-r--r--usr.bin/make/parse.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/usr.bin/make/parse.c b/usr.bin/make/parse.c
index 7dc9e61..2f1c336 100644
--- a/usr.bin/make/parse.c
+++ b/usr.bin/make/parse.c
@@ -2057,18 +2057,24 @@ ParseSkipLine(skip)
while (((c = ParseReadc()) != '\n' || lastc == '\\')
&& c != EOF) {
- if (c == '\n') {
- Buf_ReplaceLastByte(buf, (Byte)' ');
- lineno++;
+ if (c == '#' && lastc != '\\') {
+ while ((c = ParseReadc()) != '\n' && c != EOF);
- while ((c = ParseReadc()) == ' ' || c == '\t');
+ break;
+ } else {
+ if (c == '\n') {
+ Buf_ReplaceLastByte(buf, (Byte)' ');
+ lineno++;
- if (c == EOF)
- break;
- }
+ while ((c = ParseReadc()) == ' ' || c == '\t');
+
+ if (c == EOF)
+ break;
+ }
- Buf_AddByte(buf, (Byte)c);
- lastc = c;
+ Buf_AddByte(buf, (Byte)c);
+ lastc = c;
+ }
}
if (c == EOF) {
OpenPOWER on IntegriCloud