diff options
Diffstat (limited to 'miscutils/make.c')
-rw-r--r-- | miscutils/make.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/miscutils/make.c b/miscutils/make.c index 841daa93e..87f17aad7 100644 --- a/miscutils/make.c +++ b/miscutils/make.c | |||
@@ -1373,9 +1373,17 @@ process_line(char *s) | |||
1373 | 1373 | ||
1374 | // Strip comment | 1374 | // Strip comment |
1375 | // don't treat '#' in macro expansion as a comment | 1375 | // don't treat '#' in macro expansion as a comment |
1376 | if (!posix) | 1376 | // nor '#' outside macro expansion preceded by backslash |
1377 | t = find_char(s, '#'); | 1377 | if (!posix) { |
1378 | else | 1378 | char *u = s; |
1379 | while ((t = find_char(u, '#')) && t > u && t[-1] == '\\') { | ||
1380 | for (u = t; *u; ++u) { | ||
1381 | u[-1] = u[0]; | ||
1382 | } | ||
1383 | *u = '\0'; | ||
1384 | u = t; | ||
1385 | } | ||
1386 | } else | ||
1379 | t = strchr(s, '#'); | 1387 | t = strchr(s, '#'); |
1380 | if (t) | 1388 | if (t) |
1381 | *t = '\0'; | 1389 | *t = '\0'; |