Skip to content

Commit

Permalink
Fix comment parsing in interp_simple.c
Browse files Browse the repository at this point in the history
loader.rc has comment lines without a trailing space, which get
interpreted as commands. Avoid this by only matching against the
backslash character.

Reviewed by:	imp, tsoome
Differential Revision:	https://reviews.freebsd.org/D20491
  • Loading branch information
bcran authored and bcran committed Jun 1, 2019
1 parent dd3c331 commit 56449d8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion stand/common/interp_simple.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ interp_include(const char *filename)
line++;
flags = 0;
/* Discard comments */
if (strncmp(input+strspn(input, " "), "\\ ", 2) == 0)
if (strncmp(input+strspn(input, " "), "\\", 1) == 0)
continue;
cp = input;
/* Echo? */
Expand Down

0 comments on commit 56449d8

Please sign in to comment.