Add configuration include file support.
This commit is contained in:
parent
6f7b5761c6
commit
58b2c604d8
@ -90,12 +90,6 @@ readoptionsfile(const char * fname)
|
|||||||
if(!(hfile = fopen(fname, "r")))
|
if(!(hfile = fopen(fname, "r")))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if(ary_options != NULL)
|
|
||||||
{
|
|
||||||
free(ary_options);
|
|
||||||
num_options = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
while(fgets(buffer, sizeof(buffer), hfile))
|
while(fgets(buffer, sizeof(buffer), hfile))
|
||||||
{
|
{
|
||||||
linenum++;
|
linenum++;
|
||||||
@ -152,6 +146,9 @@ readoptionsfile(const char * fname)
|
|||||||
|
|
||||||
if(id == UPNP_INVALID)
|
if(id == UPNP_INVALID)
|
||||||
{
|
{
|
||||||
|
if (strcmp(name, "include") == 0)
|
||||||
|
readoptionsfile(value);
|
||||||
|
else
|
||||||
fprintf(stderr, "parsing error file %s line %d : %s=%s\n",
|
fprintf(stderr, "parsing error file %s line %d : %s=%s\n",
|
||||||
fname, linenum, name, value);
|
fname, linenum, name, value);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user