mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-28 06:52:45 +00:00
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)
This commit is contained in:
parent
328dbe4a94
commit
19a7439edd
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=132540
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user