mirror of
https://github.com/nmap/nmap.git
synced 2026-10-20 19:01:56 +00:00
Allow # comments in input files from -iL. The patch is from Tom Sellers.
This commit is contained in:
parent
adcbd54e19
commit
a3df140563
1 changed files with 6 additions and 0 deletions
6
nmap.cc
6
nmap.cc
|
|
@ -435,6 +435,12 @@ static char *grab_next_host_spec(FILE *inputfd, int argc, char **fakeargv) {
|
|||
if (host_spec_index == 0) continue;
|
||||
host_spec[host_spec_index] = '\0';
|
||||
return host_spec;
|
||||
} else if (ch == '#') {
|
||||
/* Found a comment marker, ignore everything until EOL or EOF */
|
||||
while ((ch = getc(inputfd)) != EOF && ch != '\n')
|
||||
;
|
||||
if (ch != EOF)
|
||||
ungetc(ch, inputfd);
|
||||
} else if (host_spec_index < sizeof(host_spec) / sizeof(char) -1) {
|
||||
host_spec[host_spec_index++] = (char) ch;
|
||||
} else fatal("One of the host_specifications from your input file is too long (> %d chars)", (int) sizeof(host_spec));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue