allow comments in hostlist

comments must start with "#", ";", "/" or newline at beginning of line
This commit is contained in:
[anp/hsw] 2024-08-10 10:04:16 +07:00 committed by bol-van
parent 4df4d193d2
commit 183ce40aa8
2 changed files with 4 additions and 0 deletions

View File

@ -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);

View File

@ -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);