Browse Source

allow comments in hostlist

comments must start with "#", ";", "/" or newline at beginning of line
pull/315/head
[anp/hsw] 8 months ago
committed by bol-van
parent
commit
183ce40aa8
  1. 2
      nfq/hostlist.c
  2. 2
      tpws/hostlist.c

2
nfq/hostlist.c

@ -51,6 +51,7 @@ bool AppendHostList(strpool **hostlist, char *filename)
e = zbuf + zsize;
while(p<e)
{
if ( *p == '#' || *p == ';' || *p == '/' || *p == '\n' ) continue;
if (!addpool(hostlist,&p,e))
{
fprintf(stderr, "Not enough memory to store host list : %s\n", filename);
@ -74,6 +75,7 @@ bool AppendHostList(strpool **hostlist, char *filename)
while (fgets(s, 256, F))
{
p = s;
if ( *p == '#' || *p == ';' || *p == '/' || *p == '\n' ) continue;
if (!addpool(hostlist,&p,p+strlen(p)))
{
fprintf(stderr, "Not enough memory to store host list : %s\n", filename);

2
tpws/hostlist.c

@ -51,6 +51,7 @@ bool AppendHostList(strpool **hostlist, char *filename)
e = zbuf + zsize;
while(p<e)
{
if ( *p == '#' || *p == ';' || *p == '/' || *p == '\n' ) continue;
if (!addpool(hostlist,&p,e))
{
fprintf(stderr, "Not enough memory to store host list : %s\n", filename);
@ -74,6 +75,7 @@ bool AppendHostList(strpool **hostlist, char *filename)
while (fgets(s, 256, F))
{
p = s;
if ( *p == '#' || *p == ';' || *p == '/' || *p == '\n' ) continue;
if (!addpool(hostlist,&p,p+strlen(p)))
{
fprintf(stderr, "Not enough memory to store host list : %s\n", filename);

Loading…
Cancel
Save