Fix comment parsing in interp_simple.c

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
This commit is contained in:
Rebecca Cran 2019-06-01 19:47:15 +00:00
parent 15c0034ff2
commit ea13a93166

View File

@ -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? */