From: Adam Dickmeiss Date: Fri, 11 Oct 2013 11:58:12 +0000 (+0200) Subject: Use NULL path for non-abs XML config fname X-Git-Tag: v5.0.2~5 X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=commitdiff_plain;h=0159b1dd08a8c5498fb87fffe000bff170f069f8 Use NULL path for non-abs XML config fname --- diff --git a/src/statserv.c b/src/statserv.c index e3b09c5..5388730 100644 --- a/src/statserv.c +++ b/src/statserv.c @@ -523,7 +523,6 @@ static void xml_config_read(const char *base_path) static void xml_config_open(void) { - WRBUF base_path; const char *last_p; const char *fname = control_block.xml_config; if (!getcwd(gfs_root_dir, FILENAME_MAX)) @@ -563,7 +562,6 @@ static void xml_config_open(void) } } } - base_path = wrbuf_alloc(); last_p = strrchr(fname, #ifdef WIN32 '\\' @@ -572,11 +570,14 @@ static void xml_config_open(void) #endif ); if (last_p) + { + WRBUF base_path = wrbuf_alloc(); wrbuf_write(base_path, fname, last_p - fname); + xml_config_read(wrbuf_cstr(base_path)); + wrbuf_destroy(base_path); + } else - wrbuf_puts(base_path, "."); - xml_config_read(wrbuf_cstr(base_path)); - wrbuf_destroy(base_path); + xml_config_read(0); #endif }