From 50fcf93ec6c9421d29c65206ef46652f698c77a5 Mon Sep 17 00:00:00 2001 From: Ron Pedde Date: Tue, 17 May 2005 04:24:35 +0000 Subject: [PATCH] fix problem with missing paths in config file --- src/configfile.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/configfile.c b/src/configfile.c index 93333c76..d1be74c7 100644 --- a/src/configfile.c +++ b/src/configfile.c @@ -373,19 +373,6 @@ int config_read(char *file) { fclose(fin); 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 */ pce=config_elements; err=0; @@ -412,6 +399,19 @@ int config_read(char *file) { 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 */ sprintf(path_buffer,"%s/index.html",config.web_root);