mirror of
https://github.com/bol-van/zapret.git
synced 2025-01-03 23:10:35 +05:00
allow comments in hostlist
comments must start with "#", ";", "/" or newline at beginning of line
This commit is contained in:
parent
4df4d193d2
commit
183ce40aa8
@ -51,6 +51,7 @@ bool AppendHostList(strpool **hostlist, char *filename)
|
|||||||
e = zbuf + zsize;
|
e = zbuf + zsize;
|
||||||
while(p<e)
|
while(p<e)
|
||||||
{
|
{
|
||||||
|
if ( *p == '#' || *p == ';' || *p == '/' || *p == '\n' ) continue;
|
||||||
if (!addpool(hostlist,&p,e))
|
if (!addpool(hostlist,&p,e))
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Not enough memory to store host list : %s\n", filename);
|
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))
|
while (fgets(s, 256, F))
|
||||||
{
|
{
|
||||||
p = s;
|
p = s;
|
||||||
|
if ( *p == '#' || *p == ';' || *p == '/' || *p == '\n' ) continue;
|
||||||
if (!addpool(hostlist,&p,p+strlen(p)))
|
if (!addpool(hostlist,&p,p+strlen(p)))
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Not enough memory to store host list : %s\n", filename);
|
fprintf(stderr, "Not enough memory to store host list : %s\n", filename);
|
||||||
|
@ -51,6 +51,7 @@ bool AppendHostList(strpool **hostlist, char *filename)
|
|||||||
e = zbuf + zsize;
|
e = zbuf + zsize;
|
||||||
while(p<e)
|
while(p<e)
|
||||||
{
|
{
|
||||||
|
if ( *p == '#' || *p == ';' || *p == '/' || *p == '\n' ) continue;
|
||||||
if (!addpool(hostlist,&p,e))
|
if (!addpool(hostlist,&p,e))
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Not enough memory to store host list : %s\n", filename);
|
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))
|
while (fgets(s, 256, F))
|
||||||
{
|
{
|
||||||
p = s;
|
p = s;
|
||||||
|
if ( *p == '#' || *p == ';' || *p == '/' || *p == '\n' ) continue;
|
||||||
if (!addpool(hostlist,&p,p+strlen(p)))
|
if (!addpool(hostlist,&p,p+strlen(p)))
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Not enough memory to store host list : %s\n", filename);
|
fprintf(stderr, "Not enough memory to store host list : %s\n", filename);
|
||||||
|
Loading…
Reference in New Issue
Block a user