static struct cfitem *cfsection;
static struct mempool *cfpool;
-static byte *cfdeffile = NULL;
+byte *cfdeffile = DEFAULT_CONFIG;
static void CONSTRUCTOR
conf_init(void)
cfdeffile = NULL;
}
-void
-cf_default_init(byte *filename)
-{
- cfdeffile = filename;
-}
-
-void cf_default_done(void)
-{
- if (cfdeffile)
- cf_read(cfdeffile);
-}
-
int cf_getopt(int argc,char * const argv[],
const char *shortopts,const struct option *longopts,
int *longindex)
}else if(res=='C'){
cf_read(optarg);
+ }else if(res==-1){
+ if(cfdeffile)
+ cf_read(cfdeffile);
+ return res;
}else{ /* unhandled option */
return res;
}