summaryrefslogtreecommitdiffstats
path: root/src/server/globals.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/globals.c')
-rw-r--r--src/server/globals.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/server/globals.c b/src/server/globals.c
index d84e3f7..182b2cc 100644
--- a/src/server/globals.c
+++ b/src/server/globals.c
@@ -29,8 +29,15 @@ void globals_loadConfig()
if ( name == NULL ) return;
ini_parse( name, &ini_handler, NULL );
free( name );
- if ( _basePath != NULL && _basePath[0] != '/' ) {
+ if ( _basePath == NULL || _basePath[0] == '\0' ) {
+ memlogf( "[ERROR] Need to specify basePath in " CONFIG_FILENAME );
+ exit( EXIT_FAILURE );
+ }
+ if ( _basePath[0] != '/' ) {
memlogf( "[ERROR] _basePath must be absolute!" );
exit( EXIT_FAILURE );
}
+ char *end = _basePath + strlen( _basePath ) - 1;
+ while ( end >= _basePath && *end == '/' )
+ *end-- = '\0';
}