fix problem with missing paths in config file

This commit is contained in:
Ron Pedde 2005-05-17 04:24:35 +00:00
parent 9245e282e8
commit 50fcf93ec6

View File

@ -373,19 +373,6 @@ int config_read(char *file) {
fclose(fin); fclose(fin);
free(buffer); free(buffer);
/* Set the directory components to realpaths */
realpath(config.web_root,path_buffer);
free(config.web_root);
config.web_root=strdup(path_buffer);
realpath(config.mp3dir,path_buffer);
free(config.mp3dir);
config.mp3dir=strdup(path_buffer);
realpath(config.dbdir,path_buffer);
free(config.dbdir);
config.dbdir=strdup(path_buffer);
/* check to see if all required elements are satisfied */ /* check to see if all required elements are satisfied */
pce=config_elements; pce=config_elements;
err=0; err=0;
@ -412,6 +399,19 @@ int config_read(char *file) {
pce++; pce++;
} }
/* Set the directory components to realpaths */
realpath(config.web_root,path_buffer);
free(config.web_root);
config.web_root=strdup(path_buffer);
realpath(config.mp3dir,path_buffer);
free(config.mp3dir);
config.mp3dir=strdup(path_buffer);
realpath(config.dbdir,path_buffer);
free(config.dbdir);
config.dbdir=strdup(path_buffer);
/* sanity check the paths */ /* sanity check the paths */
sprintf(path_buffer,"%s/index.html",config.web_root); sprintf(path_buffer,"%s/index.html",config.web_root);